/* Homepage V2 — MasterKis Digital Engineering Studio */

.home-section {
  padding: clamp(72px, 10vh, 110px) 0;
}

.section-intro {
  max-width: 640px;
  margin-bottom: 40px;
}

.section-intro h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin: 10px 0 14px;
}

.section-actions {
  margin-top: 36px;
}

/* Hero */
.hero {
  position: relative;
  min-height: calc(100vh - var(--header-h));
  display: grid;
  place-items: center;
  padding: clamp(36px, 7vh, 72px) 20px;
  overflow: hidden;
  text-align: center;
  isolation: isolate;
}

.hero__glow {
  position: absolute;
  inset: 12% 8% auto;
  height: 46%;
  max-width: 780px;
  margin: 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle, rgba(224, 180, 92, 0.2), transparent 68%),
    radial-gradient(circle at 80% 30%, rgba(127, 159, 214, 0.16), transparent 55%);
  filter: blur(30px);
  z-index: -2;
  animation: glowPulse 7s ease-in-out infinite;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
  opacity: 0.55;
  pointer-events: none;
}

.hero__content {
  width: min(760px, 100%);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero__label {
  margin-bottom: 18px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero__brand {
  margin-bottom: 22px;
  animation: logoFloat 5.5s ease-in-out 1.2s infinite;
}

.hero-logo {
  width: min(148px, 42vw);
  margin: 0 auto;
  border-radius: 24px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 22px 48px rgba(0, 0, 0, 0.42);
}

.hero__title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 5.5vw, 3.5rem);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero__title span {
  display: block;
}

.hero__title-accent {
  margin-top: 0.1em;
  background-image: linear-gradient(105deg, #9bb4df 0%, #e0b45c 50%, #f3d9a1 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.hero__lead {
  width: min(34rem, 100%);
  margin-top: 20px;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.12rem);
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
  margin-top: 30px;
}

.hero__actions .btn {
  min-width: 168px;
}

.hero__actions .btn-primary {
  position: relative;
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(224, 180, 92, 0.22);
}

.hero__actions .btn-primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 20%, rgba(255, 255, 255, 0.28), transparent 80%);
  transform: translateX(-120%);
  transition: transform 0.55s var(--ease);
}

.hero__actions .btn-primary:hover::after {
  transform: translateX(120%);
}

.hero__actions .btn:active {
  transform: translateY(1px) scale(0.98);
}

.hero__tagline {
  margin-top: 22px;
  color: var(--muted);
  font-size: 0.92rem;
  font-style: italic;
  letter-spacing: 0.01em;
}

.hero__flow {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 8px;
  margin-top: 36px;
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero__flow li {
  display: inline-flex;
  align-items: center;
}

.hero__flow span {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
  animation: flowPulse 3.6s var(--ease) infinite;
}

.hero__flow li:nth-child(1) span { animation-delay: 0s; }
.hero__flow li:nth-child(3) span { animation-delay: 0.35s; }
.hero__flow li:nth-child(5) span { animation-delay: 0.7s; }
.hero__flow li:nth-child(7) span { animation-delay: 1.05s; }
.hero__flow li:nth-child(9) span { animation-delay: 1.4s; }
.hero__flow li:nth-child(11) span { animation-delay: 1.75s; }

.hero__flow i {
  width: 16px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

@keyframes flowPulse {
  0%, 100% { border-color: rgba(255, 255, 255, 0.1); color: var(--muted); }
  40% { border-color: rgba(224, 180, 92, 0.45); color: var(--text); }
}

.reveal-up {
  opacity: 0;
  transform: translateY(24px);
  animation: heroEnter 0.85s var(--ease) forwards;
}

.hero__label { animation-delay: 0.05s; }
.hero__brand { animation-delay: 0.12s; }
.hero__title span:nth-child(1) { animation-delay: 0.2s; }
.hero__title span:nth-child(2) { animation-delay: 0.32s; }
.hero__lead { animation-delay: 0.44s; }
.hero__actions { animation-delay: 0.56s; }
.hero__tagline { animation-delay: 0.64s; }
.hero__flow { animation-delay: 0.72s; }

/* Services */
.service-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.service-card {
  position: relative;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 60%), var(--surface);
  overflow: hidden;
  transition: transform 0.35s var(--ease), border-color 0.35s var(--ease);
}

.service-card::before {
  content: "";
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 0;
  height: 1px;
  background: var(--grad);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}

.service-card:hover {
  transform: translateY(-6px);
  border-color: rgba(224, 180, 92, 0.35);
}

.service-card:hover::before {
  transform: scaleX(1);
}

.service-card__top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.service-card__num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--accent);
  transition: transform 0.35s var(--ease);
}

.service-card:hover .service-card__num {
  transform: translateX(4px);
}

.service-card__icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--secondary);
  box-shadow: 0 0 0 6px rgba(127, 159, 214, 0.15);
}

.service-card h3 {
  font-family: var(--font-display);
  font-size: 1.15rem;
  margin-bottom: 10px;
}

.service-card p {
  color: var(--muted);
  font-size: 0.94rem;
  max-height: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease), opacity 0.35s var(--ease), margin 0.35s var(--ease);
}

.service-card:hover p,
.service-card:focus-within p {
  max-height: 120px;
  opacity: 1;
  margin-bottom: 14px;
}

.service-card__cta {
  display: inline-flex;
  color: var(--accent);
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  transition: 0.35s var(--ease);
}

.service-card:hover .service-card__cta,
.service-card:focus-within .service-card__cta {
  opacity: 1;
  transform: none;
}

/* Builder */
.builder {
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: var(--surface);
  padding: clamp(22px, 4vw, 36px);
}

.builder__progress {
  display: flex;
  gap: 8px;
  margin-bottom: 28px;
}

.builder__progress span {
  flex: 1;
  height: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

.builder__progress span.is-active {
  background: var(--grad);
}

.builder__panel h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  margin-bottom: 18px;
}

.builder__choices {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.builder__chip {
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text);
  cursor: pointer;
  transition: 0.25s var(--ease);
}

.builder__chip:hover,
.builder__chip.is-selected {
  border-color: rgba(224, 180, 92, 0.5);
  background: var(--accent-soft);
  color: var(--accent);
}

.builder__nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.builder__result {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 18px 0 24px;
}

.builder__result li {
  margin-bottom: 0;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
}

.builder__saved {
  margin: 12px 0 0;
  color: var(--mk-success, #3ecf8e);
  font-size: 0.9rem;
  font-weight: 500;
}

.builder__capture {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.02);
}

.builder__capture-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .builder__capture-grid {
    grid-template-columns: 1fr 1fr;
  }
}

/* Process */
.process-track {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 10px;
}

.process-step {
  padding: 18px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  min-height: 160px;
  transition: border-color 0.35s var(--ease), transform 0.35s var(--ease), background 0.35s var(--ease);
}

.process-step.is-active {
  border-color: rgba(224, 180, 92, 0.45);
  background: linear-gradient(180deg, rgba(224, 180, 92, 0.1), transparent 70%), var(--surface);
  transform: translateY(-4px);
}

.process-step__index {
  display: block;
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 0.9rem;
  margin-bottom: 10px;
}

.process-step h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

.process-step p {
  color: var(--muted);
  font-size: 0.86rem;
}

/* Work mosaic */
.work-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 24px;
}

.work-filters button {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: 0.25s var(--ease);
}

.work-filters button.is-active,
.work-filters button:hover {
  color: #140f08;
  background: var(--grad);
  border-color: transparent;
}

.work-mosaic {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 14px;
}

.work-tile {
  position: relative;
  grid-column: span 4;
  min-height: 240px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
}

.work-tile--lg {
  grid-column: span 8;
  min-height: 360px;
}

.work-tile--wide {
  grid-column: span 8;
}

.work-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease);
}

.work-tile__overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 8px;
  padding: 22px;
  background: linear-gradient(180deg, transparent 20%, rgba(8, 7, 14, 0.88));
  opacity: 0;
  transform: translateY(12px);
  transition: 0.4s var(--ease);
}

.work-tile:hover img,
.work-tile:focus-visible img {
  transform: scale(1.06);
}

.work-tile:hover .work-tile__overlay,
.work-tile:focus-visible .work-tile__overlay {
  opacity: 1;
  transform: none;
}

.work-tile h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
}

.work-tile p {
  color: var(--muted);
  font-size: 0.9rem;
}

.work-tile__cta {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.86rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.work-tile.is-hidden {
  display: none;
}

.work-empty {
  margin-top: 18px;
  color: var(--muted);
}

/* Tech */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.tech-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: 0.3s var(--ease);
}

.tech-card h3 {
  font-family: var(--font-display);
  margin-bottom: 6px;
}

.tech-card__role {
  color: var(--accent);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.tech-card__usage {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
  opacity: 0.7;
  transition: opacity 0.3s var(--ease);
}

.tech-card:hover,
.tech-card:focus-visible {
  border-color: rgba(127, 159, 214, 0.4);
  transform: translateY(-3px);
}

.tech-card:hover .tech-card__usage,
.tech-card:focus-visible .tech-card__usage {
  opacity: 1;
}

/* API / Integration */
.api-panel {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background:
    linear-gradient(160deg, rgba(127, 159, 214, 0.1), transparent 45%),
    var(--surface);
  align-items: center;
}

.api-panel h2 {
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.5vw, 2.4rem);
  letter-spacing: -0.03em;
  margin: 10px 0 14px;
}

.api-list {
  list-style: none;
  display: grid;
  gap: 10px;
  margin: 18px 0 8px;
  color: var(--muted);
}

.api-list li {
  padding-left: 18px;
  position: relative;
}

.api-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.55em;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
}

.api-map {
  position: relative;
  min-height: 260px;
  display: grid;
  place-items: center;
}

.api-map__node {
  position: absolute;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid rgba(127, 159, 214, 0.35);
  background: rgba(12, 11, 18, 0.75);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text);
  transform: rotate(calc(var(--i) * 60deg)) translate(110px) rotate(calc(var(--i) * -60deg));
}

.api-map__node--core {
  position: relative;
  transform: none;
  padding: 18px 22px;
  border-color: rgba(224, 180, 92, 0.5);
  background: linear-gradient(135deg, rgba(224, 180, 92, 0.18), rgba(127, 159, 214, 0.12));
  color: var(--accent);
  z-index: 1;
}

@media (min-width: 900px) {
  .api-panel {
    grid-template-columns: 1.15fr 0.85fr;
  }
}

/* Automation / Why / Check / CTA */
.automation-panel,
.check-panel,
.final-cta {
  padding: clamp(28px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 6px);
  background:
    linear-gradient(135deg, rgba(224, 180, 92, 0.08), transparent 40%),
    linear-gradient(225deg, rgba(127, 159, 214, 0.08), transparent 45%),
    var(--surface);
}

.automation-panel {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 28px;
  align-items: center;
}

.flow-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  justify-content: center;
}

.flow-chain span {
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.85rem;
}

.flow-chain i {
  width: 24px;
  height: 1px;
  background: var(--grad);
}

.why-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}

.why-card {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.why-card span {
  color: var(--accent);
  font-family: var(--font-display);
}

.why-card h3 {
  margin: 10px 0 8px;
  font-family: var(--font-display);
}

.why-card p {
  color: var(--muted);
  font-size: 0.92rem;
}

.check-result {
  margin-top: 18px;
  display: grid;
  gap: 14px;
  justify-items: start;
}

.final-cta {
  text-align: center;
}

.final-cta__formula {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.8rem;
}

.final-cta__formula strong {
  color: var(--accent);
  font-family: var(--font-display);
  letter-spacing: 0.04em;
}

.final-cta h2 {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}

.final-cta .lead {
  margin: 0 auto 8px;
  max-width: 540px;
}

/* Section rail */
.section-rail {
  position: fixed;
  right: 18px;
  top: 50%;
  transform: translateY(-50%);
  display: none;
  flex-direction: column;
  gap: 8px;
  z-index: 40;
}

.section-rail button {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: rgba(12, 11, 18, 0.7);
  color: var(--muted);
  font-size: 0.7rem;
  cursor: pointer;
}

.section-rail button.is-active {
  color: #140f08;
  background: var(--grad);
  border-color: transparent;
}

/* Cursor */
.cursor {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 9999;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(224, 180, 92, 0.7);
  border-radius: 50%;
  pointer-events: none;
  transform: translate(-50%, -50%);
  transition: width 0.2s var(--ease), height 0.2s var(--ease), background 0.2s var(--ease);
  mix-blend-mode: difference;
}

.cursor.is-label {
  width: auto;
  height: auto;
  min-width: 88px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(224, 180, 92, 0.92);
  border-color: transparent;
  color: #140f08;
  mix-blend-mode: normal;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.cursor__label {
  display: none;
}

.cursor.is-label .cursor__label {
  display: block;
}

body.has-custom-cursor,
body.has-custom-cursor a,
body.has-custom-cursor button {
  cursor: none;
}

@keyframes heroEnter {
  to {
    opacity: 1;
    transform: none;
  }
}

@keyframes logoFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes glowPulse {
  0%, 100% { opacity: 0.75; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}

@media (min-width: 1100px) {
  .section-rail {
    display: flex;
  }
}

@media (max-width: 980px) {
  .service-grid,
  .tech-grid,
  .why-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .process-track {
    grid-template-columns: 1fr;
  }

  .process-step {
    min-height: 0;
  }

  .work-tile,
  .work-tile--lg,
  .work-tile--wide {
    grid-column: span 12;
    min-height: 260px;
  }

  .automation-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .service-grid,
  .tech-grid,
  .why-grid {
    grid-template-columns: 1fr;
  }

  .hero__actions,
  .builder__nav {
    width: 100%;
    flex-direction: column;
  }

  .hero__actions .btn,
  .builder__nav .btn {
    width: 100%;
  }

  .service-card p {
    max-height: none;
    opacity: 1;
    margin-bottom: 12px;
  }

  .service-card__cta {
    opacity: 1;
    transform: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__glow,
  .hero__brand,
  .hero__flow span,
  .reveal-up,
  .service-card,
  .work-tile img,
  .tech-card {
    animation: none !important;
    transition: none !important;
  }

  .reveal-up {
    opacity: 1;
    transform: none;
  }
}
