/* GlorySmile — contact page (body[data-page='contact']), "V34 Night".
   Rhythm: hero on --base (the one loud moment: giant "Пиши ни", the mirror photo in a lit halo, the channels),
   topics in the --night room (each opens the mail app with a subject), quick answers on --base-2
   next to two friends laughing, then the footer. */

body[data-page='contact'] main { overflow-x: clip; }

/* ---------- 1. Hero ---------- */
.ct-hero { position: relative; isolation: isolate; }
.ct-hero__in {
  display: grid; grid-template-columns: minmax(0, 1fr);
  grid-template-areas: 'title' 'media' 'channels';
  gap: clamp(2.25rem, 7vw, 3rem);
  padding-block: clamp(2rem, 6vw, 4.5rem) clamp(4rem, 9vw, 7rem);
}
.ct-hero__title {
  grid-area: title;
  font-size: clamp(4.5rem, 25vw, 16rem);
  font-weight: 200; line-height: 0.86; letter-spacing: -0.055em;
}
.ct-hero__title span { display: block; }
.ct-hero__title span + span { padding-left: 0.9em; }

.ct-hero__media { grid-area: media; position: relative; width: min(100%, 620px); aspect-ratio: 1; justify-self: center; }
/* the ring light is a light source: ultraviolet bloom behind the mirror */
.ct-hero__media::before {
  content: ''; position: absolute; inset: -16%; z-index: -1; border-radius: 50%; pointer-events: none;
  background: radial-gradient(closest-side, rgba(108, 59, 255, 0.55), rgba(108, 59, 255, 0.2) 55%, rgba(108, 59, 255, 0));
}
.ct-hero__img { position: absolute; inset: 6%; background: var(--night); box-shadow: 0 0 0 1px rgba(169, 139, 255, 0.25); }
.ct-hero__img > img { object-position: 60% 40%; }
.ct-hero__halo {
  --size: 100%; --ring: 3px; position: absolute; inset: 0;
  filter: saturate(2.4) drop-shadow(0 0 10px rgba(200, 180, 255, 0.9)) drop-shadow(0 0 34px rgba(108, 59, 255, 0.8));
}

/* Channels: label over a giant value, arrow circle on the right */
.ct-channels { grid-area: channels; display: grid; gap: 1.25rem; justify-items: start; min-width: 0; }
.ct-list { list-style: none; padding: 0; width: 100%; border-top: 1px solid var(--hair); }
.ct-list li { border-bottom: 1px solid var(--hair); }
.ct-row {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: 'label go' 'value go';
  align-items: center; column-gap: 1rem; row-gap: 0.4rem;
  min-height: 88px; padding-block: clamp(1.1rem, 2.6vw, 1.75rem);
  text-decoration: none;
}
.ct-row__label { grid-area: label; font-size: var(--t-s); font-weight: 500; color: var(--text-2); }
.ct-row__value {
  grid-area: value;
  font-family: var(--f-display); font-weight: 300; letter-spacing: -0.04em; line-height: 1.05;
  font-size: clamp(1.4rem, 6.4vw, 2.5rem);
  min-width: 0; overflow-wrap: anywhere;
  transition: color 0.3s var(--ease), transform 0.5s var(--ease);
}
.ct-row__go {
  grid-area: go;
  display: grid; place-items: center;
  width: clamp(48px, 5vw, 72px); aspect-ratio: 1; border-radius: 50%;
  border: 1.5px solid var(--line); background: var(--surface); color: var(--text);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.5s var(--ease), box-shadow 0.3s var(--ease);
}
.ct-row__go svg { width: 42%; height: 42%; }
.ct-row:hover .ct-row__value { color: var(--violet-hi); transform: translateX(0.08em); }
.ct-row:hover .ct-row__go, .ct-row:focus-visible .ct-row__go {
  background: var(--ultra); border-color: var(--ultra); color: var(--on-accent); transform: rotate(-45deg);
  box-shadow: 0 0 26px rgba(108, 59, 255, 0.85);
}
.ct-row:active .ct-row__go { background: var(--ultra-deep); border-color: var(--ultra-deep); }
.ct-row:focus-visible { outline-offset: 6px; }

/* Tablets: "Пиши ни" and the mirror side by side, the email row full width right under them,
   so the address is on the first screen instead of below a 620px photo */
@media (min-width: 600px) and (max-width: 899px) {
  .ct-hero__in {
    grid-template-columns: auto minmax(0, 1fr); grid-template-areas: 'title media' 'channels channels';
    align-items: center; column-gap: clamp(1.5rem, 4vw, 2.5rem);
  }
  .ct-hero__title { font-size: 15vw; }
  .ct-hero__media { width: 100%; justify-self: end; }
}

@media (min-width: 900px) {
  .ct-hero__in {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    grid-template-areas: 'title media' 'channels media';
    grid-template-rows: auto auto;
    align-content: center;
    column-gap: clamp(2.5rem, 5vw, 6rem); row-gap: clamp(2.25rem, 4vw, 3.5rem);
    min-height: calc(100svh - var(--header-h));
    min-height: min(calc(100svh - var(--header-h)), 960px);
  }
  /* "Пиши" is ~3.1em wide: 13.5rem is the most the left column holds once the wrap stops growing (1520px) */
  .ct-hero__title { font-size: clamp(5rem, 12.5vw, 13.5rem); align-self: end; }
  .ct-hero__media { align-self: center; justify-self: end; }
  .ct-channels { align-self: start; }
  .ct-row__value { font-size: clamp(1.75rem, 3.3vw, 3.5rem); }
}

/* ---------- 2. Topics: the dark room ---------- */
.ct-topics { position: relative; isolation: isolate; overflow: clip; background: var(--night); color: var(--text); }
/* light from above: a wide ultraviolet bloom on the top edge of the dark room */
.ct-topics::before {
  content: ''; position: absolute; z-index: -1; pointer-events: none;
  left: 50%; top: 0; width: min(1400px, 140vw); aspect-ratio: 2.2; transform: translate(-50%, -55%);
  background: radial-gradient(closest-side, rgba(108, 59, 255, 0.42), rgba(108, 59, 255, 0.12) 55%, rgba(108, 59, 255, 0));
}
.ct-topics__in { display: grid; gap: clamp(2rem, 5vw, 3rem); padding-block: clamp(4.5rem, 10vw, 9rem); }
.ct-topics__title { font-size: var(--t-2xl); font-weight: 200; letter-spacing: -0.04em; }
.ct-topics__hint { margin-top: 1rem; color: var(--text-2); max-width: 30ch; }
.ct-topics__list { list-style: none; padding: 0; display: grid; gap: 0.85rem; }
.ct-topic {
  display: flex; align-items: center; gap: 1rem;
  min-height: 76px; padding: 0.7rem 0.7rem 0.7rem clamp(1.4rem, 3vw, 2.25rem);
  border-radius: var(--r-pill); border: 1.5px solid var(--line); background: var(--base);
  text-decoration: none;
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.25s var(--ease), box-shadow 0.3s var(--ease);
}
.ct-topic__text { display: grid; gap: 0.1rem; margin-right: auto; min-width: 0; }
.ct-topic__name { font-family: var(--f-display); font-weight: 300; font-size: var(--t-xl); letter-spacing: -0.03em; line-height: 1.1; }
.ct-topic__sub { font-size: var(--t-s); color: var(--text-2); font-variant-numeric: tabular-nums; transition: color 0.3s var(--ease); }
.ct-topic__go {
  display: grid; place-items: center; flex: none; margin-left: auto;
  width: 54px; height: 54px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--hair); color: var(--violet-hi);
  transition: background-color 0.3s var(--ease), border-color 0.3s var(--ease), color 0.3s var(--ease), transform 0.5s var(--ease);
}
.ct-topic__go svg { width: 22px; height: 22px; }
.ct-topic:hover, .ct-topic:focus-visible {
  background: var(--ultra); border-color: var(--ultra); color: var(--on-accent);
  box-shadow: 0 16px 50px -14px rgba(108, 59, 255, 0.85);
}
/* focus fills the pill with ultra like hover, so the ring around it is the pearl text colour */
.ct-topic:focus-visible { outline-color: var(--text); }
.ct-topic:hover .ct-topic__sub, .ct-topic:focus-visible .ct-topic__sub { color: var(--on-accent); }
.ct-topic:hover .ct-topic__go, .ct-topic:focus-visible .ct-topic__go { background: var(--ultra-deep); border-color: rgba(251, 249, 255, 0.55); color: var(--on-accent); transform: rotate(-45deg); }
.ct-topic:active { transform: scale(0.985); }

@media (min-width: 900px) {
  .ct-topics__in { grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr); align-items: center; column-gap: clamp(2.5rem, 6vw, 7rem); }
}

/* ---------- 3. Quick answers, next to two friends laughing ---------- */
.ct-help { position: relative; isolation: isolate; overflow: clip; background: var(--base-2); border-top: 1px solid var(--hair); }
.ct-help__in {
  display: grid; grid-template-columns: minmax(0, 1fr);
  gap: clamp(1.5rem, 5vw, 2.5rem); padding-bottom: clamp(4.5rem, 9vw, 7.5rem);
}
/* phones: the photo bleeds edge to edge and dissolves into the band above and below */
.ct-help__media { position: relative; margin-inline: calc(-1 * var(--gutter)); aspect-ratio: 3 / 2; }
.ct-help__media img {
  width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%;
  -webkit-mask-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.5) 7%, #000 16%, #000 60%, rgba(0, 0, 0, 0.7) 74%, rgba(0, 0, 0, 0.3) 88%, transparent);
          mask-image: linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.5) 7%, #000 16%, #000 60%, rgba(0, 0, 0, 0.7) 74%, rgba(0, 0, 0, 0.3) 88%, transparent);
}
.ct-help__body { display: grid; gap: clamp(2rem, 4vw, 2.75rem); align-content: start; min-width: 0; }
.ct-help__title { font-size: var(--t-2xl); font-weight: 200; letter-spacing: -0.04em; }

/* answers: icon on the left, title over the line, split by hairlines */
.ct-answers { list-style: none; padding: 0; display: grid; border-top: 1px solid rgba(169, 139, 255, 0.2); }
.ct-answer {
  display: grid; grid-template-columns: 56px minmax(0, 1fr); column-gap: 1.1rem; row-gap: 0.2rem; align-items: center;
  padding-block: 1.35rem; border-bottom: 1px solid rgba(169, 139, 255, 0.2);
}
.ct-answer__icon {
  grid-row: 1 / span 2; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; color: var(--violet-hi);
  background: radial-gradient(closest-side, rgba(108, 59, 255, 0.5), rgba(108, 59, 255, 0.12));
  box-shadow: inset 0 0 0 1px rgba(169, 139, 255, 0.34), 0 0 30px -6px rgba(108, 59, 255, 0.75);
}
.ct-answer__icon svg { width: 26px; height: 26px; }
.ct-answer__title { align-self: end; font-family: var(--f-text); font-weight: 600; font-size: var(--t-l); letter-spacing: -0.01em; line-height: 1.25; }
.ct-answer__text { align-self: start; color: var(--text-2); }
/* the terms link keeps a 44px target without pushing its row apart */
.ct-answer__text a {
  display: inline-flex; align-items: center; min-height: 44px; margin-block: -0.6rem;
  color: var(--text); font-weight: 600; text-decoration-color: var(--violet-hi);
}
.ct-answer__text a:hover { color: var(--lilac); }
.ct-help__more { justify-self: start; }

@media (min-width: 900px) {
  .ct-help__in {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); align-items: center;
    column-gap: clamp(2.5rem, 6vw, 7rem); padding-block: clamp(4.5rem, 9vw, 8rem);
  }
  /* desktop: the photo runs out of the left edge and dissolves into the band on every side.
     Long eased fades (several stops, not one straight ramp), so no edge reads as a line;
     both faces stay inside the fully lit core (22-62% across, 18-56% down). */
  .ct-help__media { margin-inline: calc(-1 * var(--gutter)) 0; aspect-ratio: 4 / 3; }
  .ct-help__media img {
    -webkit-mask-image:
      linear-gradient(to right, transparent, rgba(0, 0, 0, 0.35) 7%, rgba(0, 0, 0, 0.8) 15%, #000 22%, #000 62%, rgba(0, 0, 0, 0.75) 76%, rgba(0, 0, 0, 0.3) 89%, transparent),
      linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.5) 7%, #000 18%, #000 56%, rgba(0, 0, 0, 0.7) 70%, rgba(0, 0, 0, 0.3) 85%, transparent);
    -webkit-mask-composite: source-in;
            mask-image:
      linear-gradient(to right, transparent, rgba(0, 0, 0, 0.35) 7%, rgba(0, 0, 0, 0.8) 15%, #000 22%, #000 62%, rgba(0, 0, 0, 0.75) 76%, rgba(0, 0, 0, 0.3) 89%, transparent),
      linear-gradient(to bottom, transparent, rgba(0, 0, 0, 0.5) 7%, #000 18%, #000 56%, rgba(0, 0, 0, 0.7) 70%, rgba(0, 0, 0, 0.3) 85%, transparent);
            mask-composite: intersect;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ct-row:hover .ct-row__value { transform: none; }
}
