/**
 * KSE Contact — split rail + inquiry desk
 */

.kse-ct {
  padding:
    calc(var(--hm-chrome-h, 6rem) + clamp(1rem, 2.5vw, 1.5rem))
    var(--kse-section-x)
    clamp(2.5rem, 6vw, 4rem);
}

.kse-ct__frame {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 0;
  max-width: 1180px;
  margin: 0 auto;
  min-height: min(78vh, 44rem);
  border-radius: calc(var(--kse-radius-xl) + 4px);
  overflow: hidden;
  border: 1px solid rgba(var(--kse-brand-rgb), 0.14);
  box-shadow: var(--kse-shadow-md);
  background: #fff;
}

/* ── Dark rail ── */
.kse-ct__rail {
  position: relative;
  display: flex;
  color: var(--kse-hero-ink);
  background:
    linear-gradient(160deg, #12152c 0%, #0a0c18 48%, #070912 100%);
  overflow: hidden;
}

.kse-ct__rail-bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.kse-ct__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(2px);
}

.kse-ct__orb--a {
  top: -18%;
  left: -20%;
  width: 70%;
  height: 55%;
  background: radial-gradient(circle, rgba(var(--kse-brand-rgb), 0.38) 0%, transparent 70%);
  animation: kse-ct-drift 14s ease-in-out infinite alternate;
}

.kse-ct__orb--b {
  right: -25%;
  bottom: -20%;
  width: 65%;
  height: 55%;
  background: radial-gradient(circle, rgba(var(--kse-brand-bright-rgb), 0.22) 0%, transparent 68%);
  animation: kse-ct-drift 18s ease-in-out infinite alternate-reverse;
}

.kse-ct__scan {
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 3px,
      rgba(255, 255, 255, 0.015) 3px,
      rgba(255, 255, 255, 0.015) 4px
    );
  opacity: 0.7;
  mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.55), transparent 85%);
}

@keyframes kse-ct-drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to { transform: translate3d(4%, 3%, 0) scale(1.06); }
}

.kse-ct__rail-body {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0;
  width: 100%;
  padding: clamp(1.75rem, 4vw, 2.75rem);
}

.kse-ct__mark {
  margin: 0 0 1.35rem;
  font-family: var(--kse-mono);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(var(--kse-brand-bright-rgb), 0.95);
}

.kse-ct__title {
  margin: 0 0 1.1rem;
  font-size: clamp(2.2rem, 4.4vw, 3.4rem);
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.02;
  color: #fff;
}

.kse-ct__lead {
  margin: 0 0 2rem;
  max-width: 22rem;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--kse-hero-muted);
}

.kse-ct__lines {
  display: flex;
  flex-direction: column;
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.kse-ct__line {
  display: grid;
  grid-template-columns: 4.5rem 1fr;
  gap: 0.85rem;
  align-items: baseline;
  padding: 0.95rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  text-decoration: none;
  color: inherit;
  transition: background 0.2s ease, padding-left 0.2s ease;
}

a.kse-ct__line:hover {
  background: rgba(255, 255, 255, 0.03);
  padding-left: 0.35rem;
}

.kse-ct__line span {
  font-family: var(--kse-mono);
  font-size: 0.58rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(244, 246, 255, 0.4);
}

.kse-ct__line strong {
  font-size: 0.92rem;
  font-weight: 500;
  color: rgba(244, 246, 255, 0.9);
  line-height: 1.4;
  word-break: break-word;
}

a.kse-ct__line:hover strong {
  color: #fff;
}

/* ── Inquiry desk ── */
.kse-ct__desk {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding: clamp(1.5rem, 3.5vw, 2.35rem);
  background:
    linear-gradient(180deg, #fbfbfe 0%, #ffffff 40%, #f7f8fc 100%);
}

.kse-ct__desk-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--kse-line);
}

.kse-ct__desk-kicker {
  margin: 0 0 0.3rem;
  font-family: var(--kse-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--kse-brand);
}

.kse-ct__desk-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--kse-ink);
}

.kse-ct__desk-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin: 0.2rem 0 0;
  font-family: var(--kse-mono);
  font-size: 0.62rem;
  letter-spacing: 0.04em;
  color: var(--kse-muted);
  white-space: nowrap;
}

.kse-ct__live {
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.16);
  animation: kse-ct-pulse 2.2s ease-in-out infinite;
}

@keyframes kse-ct-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.55; }
}

.kse-ct__flash {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: var(--kse-radius);
  font-size: 0.875rem;
  line-height: 1.45;
}

.kse-ct__flash--success {
  background: rgba(5, 150, 105, 0.08);
  border: 1px solid rgba(5, 150, 105, 0.2);
  color: #047857;
}

.kse-ct__flash--error {
  background: rgba(239, 68, 68, 0.07);
  border: 1px solid rgba(239, 68, 68, 0.2);
  color: #b91c1c;
}

.kse-ct__form {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  flex: 1;
}

.kse-ct__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.95rem 1rem;
}

.kse-ct__field {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  min-width: 0;
}

.kse-ct__field--wide {
  grid-column: 1 / -1;
}

.kse-ct__field > span,
.kse-ct__topics legend {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--kse-muted);
}

.kse-ct__field input,
.kse-ct__field textarea {
  width: 100%;
  padding: 0.7rem 0;
  border: 0;
  border-bottom: 1.5px solid var(--kse-line-strong);
  border-radius: 0;
  background: transparent;
  font-family: var(--kse-font);
  font-size: 1rem;
  color: var(--kse-ink);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.kse-ct__field input::placeholder,
.kse-ct__field textarea::placeholder {
  color: var(--kse-muted-light);
}

.kse-ct__field input:hover,
.kse-ct__field textarea:hover {
  border-bottom-color: rgba(var(--kse-brand-rgb), 0.35);
}

.kse-ct__field input:focus,
.kse-ct__field textarea:focus {
  outline: none;
  border-bottom-color: var(--kse-brand);
  box-shadow: 0 1px 0 0 var(--kse-brand);
}

.kse-ct__field textarea {
  min-height: 6.5rem;
  resize: vertical;
  line-height: 1.55;
  padding-top: 0.55rem;
}

.kse-ct__topics {
  margin: 0;
  padding: 0;
  border: none;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.kse-ct__topics legend {
  padding: 0;
}

.kse-ct__topic-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.kse-ct__topic-input {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  white-space: nowrap;
}

.kse-ct__topic {
  display: inline-flex;
  align-items: center;
  padding: 0.48rem 0.78rem;
  border: 1px solid var(--kse-line);
  border-radius: var(--kse-radius);
  background: #fff;
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--kse-muted);
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.kse-ct__topic:hover {
  border-color: var(--kse-brand-mist);
  color: var(--kse-ink-soft);
}

.kse-ct__topic-input:checked + .kse-ct__topic {
  border-color: var(--kse-brand);
  background: var(--kse-brand-tint);
  color: var(--kse-brand-deep);
}

.kse-ct__topic-input:focus-visible + .kse-ct__topic {
  outline: 2px solid var(--kse-brand);
  outline-offset: 2px;
}

.kse-ct__foot {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

.kse-ct__submit {
  width: 100%;
  justify-content: center;
  min-height: 3.05rem;
}

.kse-ct__submit ion-icon {
  transition: transform 0.22s ease;
}

.kse-ct__submit:hover ion-icon {
  transform: translateX(3px);
}

.kse-ct__foot > p {
  margin: 0;
  text-align: center;
  font-size: 0.72rem;
  color: var(--kse-muted-light);
}

.kse-ct__path {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  margin: 0.25rem 0 0;
  padding: 0.85rem 0 0;
  list-style: none;
  border-top: 1px solid var(--kse-line);
}

.kse-ct__path li {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--kse-ink-soft);
}

.kse-ct__path em {
  font-family: var(--kse-mono);
  font-style: normal;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--kse-brand);
}

/* Reveal */
.kse-ct [data-kse-reveal] {
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.kse-ct [data-kse-reveal]:not(.kse-revealed) {
  opacity: 0;
}

.kse-ct__rail[data-kse-reveal]:not(.kse-revealed) {
  transform: translateX(-16px);
}

.kse-ct__desk[data-kse-reveal]:not(.kse-revealed) {
  transform: translateX(16px);
}

.kse-ct [data-kse-reveal].kse-revealed {
  opacity: 1;
  transform: none;
}

.kse-ct__desk[data-kse-reveal].kse-revealed {
  transition-delay: 0.08s;
}

/* Responsive */
@media (max-width: 960px) {
  .kse-ct__frame {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .kse-ct__rail {
    min-height: 18rem;
  }

  .kse-ct__rail-body {
    justify-content: flex-end;
    padding-bottom: 1.75rem;
  }

  .kse-ct__title {
    font-size: clamp(2rem, 8vw, 2.6rem);
  }

  .kse-ct__lead {
    max-width: none;
    margin-bottom: 1.35rem;
  }
}

@media (max-width: 640px) {
  .kse-ct {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .kse-ct__frame {
    border-radius: var(--kse-radius-xl);
  }

  .kse-ct__grid {
    grid-template-columns: 1fr;
  }

  .kse-ct__desk-head {
    flex-direction: column;
    gap: 0.65rem;
  }

  .kse-ct__line {
    grid-template-columns: 1fr;
    gap: 0.2rem;
  }

  .kse-ct__path {
    grid-template-columns: 1fr;
    gap: 0.45rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kse-ct__orb--a,
  .kse-ct__orb--b,
  .kse-ct__live,
  .kse-ct__submit ion-icon,
  .kse-ct [data-kse-reveal] {
    animation: none !important;
    transition: none !important;
  }

  .kse-ct [data-kse-reveal]:not(.kse-revealed) {
    opacity: 1;
    transform: none;
  }
}
