/* ==========================================================================
   Spacematter Apps — server-rendered landing page
   --------------------------------------------------------------------------
   Design tokens are a 1:1 port of the Flutter app's constants:
     lib/constants/app_colors.dart      -> Colors
     lib/constants/app_typography.dart  -> Typography
     lib/constants/app_spacing.dart     -> Spacing
   Breakpoints match the LayoutBuilder thresholds in the widget tree:
     900px  -> app bar, difference, showcase, service, cta, footer
     1080px -> hero only
     800px  -> brands padding
     1500px -> brands static row vs. marquee
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Reset
   -------------------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--sm-bg-white);
  color: var(--sm-text-primary);
  font-family: var(--sm-font);
  font-size: 16px;
  line-height: 1.21; /* Inter's natural leading, which Flutter uses by default */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
p,
figure,
blockquote {
  margin: 0;
}

ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

img {
  max-width: 100%;
  display: block;
}

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

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
}

input,
textarea {
  font: inherit;
  color: inherit;
}

:focus-visible {
  outline: 2px solid var(--sm-main);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */

:root {
  /* Theme colors */
  --sm-main: #7b61ff;
  --sm-accent: #f5a623;

  /* Surface colors */
  --sm-bg-white: #ffffff;
  --sm-bg-1: #fafafa;
  --sm-bg-2: #f5f5f5;
  --sm-soft-purple-white: #fcfbff;

  /* Text colors */
  --sm-text-primary: #1a1a1a;
  --sm-text-secondary: #606060;
  --sm-text-disabled: #c8c8c8;
  --sm-stroke: #e6e6e6;

  /* Status colors */
  --sm-error: #dc1717;
  --sm-warning: #fdcf36;
  --sm-success: #43c40b;
  --sm-link: #4a90e2;

  /* Spacing (AppSpacing) */
  --sm-app-margin: 16px;
  --sm-gap: 12px;
  --sm-section-spacing: 24px;
  --sm-corner-radius: 8px;
  --sm-content-width: 1080px;

  /* Type */
  --sm-font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji",
    "Segoe UI Emoji";
  --sm-title-tracking: -0.5px;

  /* Motion — Flutter's Curves.easeInOutSine / easeOutQuart */
  --sm-ease-in-out-sine: cubic-bezier(0.37, 0, 0.63, 1);
  --sm-ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --sm-ease-out-back: cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --------------------------------------------------------------------------
   3. Typography (AppTypography)
   -------------------------------------------------------------------------- */

.t-body-xxl { font-size: 24px; font-weight: 400; }
.t-body-xl  { font-size: 20px; font-weight: 400; }
.t-body-l   { font-size: 18px; font-weight: 400; }
.t-body-m   { font-size: 16px; font-weight: 400; }
.t-mbody-m  { font-size: 15px; font-weight: 400; }
.t-body-s   { font-size: 13px; font-weight: 400; }
.t-body-xs  { font-size: 12px; font-weight: 400; }

.t-title-mega,
.t-mtitle-mega,
.t-title-xl,
.t-title-l,
.t-title-m,
.t-mtitle-m {
  font-weight: 800;
  letter-spacing: var(--sm-title-tracking);
}

.t-title-mega  { font-size: 40px; }
.t-mtitle-mega { font-size: 24px; }
.t-title-xl    { font-size: 28px; }
.t-title-l     { font-size: 22px; }
.t-title-m     { font-size: 18px; }
.t-mtitle-m    { font-size: 16px; }

.t-title-s,
.t-title-xs,
.t-title-xxs {
  font-weight: 700;
  letter-spacing: var(--sm-title-tracking);
}

.t-title-s   { font-size: 16px; }
.t-title-xs  { font-size: 14px; }
.t-title-xxs { font-size: 12px; }

/* Responsive pairs — the mobile style below 900px, the desktop style above,
   matching the `isMobile ? AppTypography.mX : AppTypography.X` ternaries. */
.t-r-mega {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: var(--sm-title-tracking);
}

.t-r-title-m {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: var(--sm-title-tracking);
}

.t-r-track-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: var(--sm-title-tracking);
}

.t-r-body-m {
  font-size: 15px;
  font-weight: 400;
}

@media (min-width: 900px) {
  .t-r-mega { font-size: 40px; }
  .t-r-title-m { font-size: 18px; }
  .t-r-track-title { font-size: 28px; }
  .t-r-body-m { font-size: 16px; }
}

/* The <b> spans inside translated copy */
.accent-main { color: var(--sm-main); }
.accent-strong { color: var(--sm-text-primary); font-weight: 600; }
.accent-bold { color: var(--sm-text-primary); font-weight: 700; }
.accent-w700 { font-weight: 700; }
.accent-inherit { font-weight: 700; color: inherit; }

/* --------------------------------------------------------------------------
   4. Layout containers
   -------------------------------------------------------------------------- */

/* Container(maxWidth: 1080) + EdgeInsets.symmetric(horizontal: appMargin) */
.sm-container {
  max-width: var(--sm-content-width);
  margin-inline: auto;
  padding-inline: var(--sm-app-margin);
}

/* padding = (maxWidth - 1080) / 2, so the content box is exactly 1080 wide */
.sm-container-flush {
  width: min(var(--sm-content-width), 100% - (2 * var(--sm-app-margin)));
  margin-inline: auto;
}

.sm-skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 200;
  background: var(--sm-text-primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--sm-corner-radius);
}

.sm-skip-link:focus {
  left: 16px;
  top: 16px;
}

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

/* Anchor targets clear the fixed app bar */
#top,
#why-us,
#showcase,
#services,
#contact {
  scroll-margin-top: 56px;
}

@media (min-width: 900px) {
  #top,
  #why-us,
  #showcase,
  #services,
  #contact {
    scroll-margin-top: 72px;
  }
}

/* --------------------------------------------------------------------------
   5. App bar
   -------------------------------------------------------------------------- */

.appbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  height: 56px;
  display: flex;
  align-items: center;
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background-color 200ms ease, border-color 200ms ease,
    backdrop-filter 200ms ease;
}

.appbar.is-scrolled {
  background: rgba(255, 255, 255, 0.75);
  border-bottom-color: var(--sm-stroke);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

.appbar__inner {
  width: 100%;
  max-width: var(--sm-content-width);
  margin-inline: auto;
  padding-inline: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.appbar__logo {
  display: flex;
  align-items: center;
  gap: var(--sm-gap);
  cursor: pointer;
}

.appbar__logo img {
  width: 32px;
  height: 32px;
}

.appbar__nav {
  display: flex;
  align-items: center;
}

.appbar__links {
  display: none;
  align-items: center;
  gap: var(--sm-gap);
  margin-right: var(--sm-section-spacing);
}

.appbar__link {
  color: var(--sm-text-secondary);
  padding: 16px;
  border-radius: 4px;
  transition: color 150ms ease, background-color 150ms ease;
}

.appbar__link:hover {
  color: var(--sm-text-primary);
  background: rgba(123, 97, 255, 0.06);
}

/* OutlinedButton(side: 2px main, shape: squircle 8) */
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--sm-main);
  border: 2px solid var(--sm-main);
  border-radius: var(--sm-corner-radius);
  padding: 12px 16px;
  transition: background-color 150ms ease, color 150ms ease;
}

.btn-outline:hover {
  background: rgba(123, 97, 255, 0.08);
}

@media (min-width: 900px) {
  .appbar {
    height: 72px;
  }

  .appbar__inner {
    padding-inline: var(--sm-app-margin);
  }

  .appbar__links {
    display: flex;
  }

  .btn-outline {
    padding: 18px 24px;
  }
}

/* --------------------------------------------------------------------------
   6. Hero
   --------------------------------------------------------------------------
   Mobile styles below; the 1080px block further down switches to
   DesktopHeroLayout (bigger type, floating avatars, carousel).
   -------------------------------------------------------------------------- */

.hero {
  width: 100%;
  padding-top: 80px;
}

.hero__stack {
  position: relative;
}

.hero__headline,
.hero__desc,
.hero__cta-wrap {
  padding-inline: 20px;
}

.hero__headline {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: var(--sm-title-tracking);
  line-height: 1.2;
  color: var(--sm-text-primary);
  margin-bottom: 24px;
}

.hero__desc {
  font-size: 15px;
  line-height: 1.6;
  color: var(--sm-text-secondary);
  margin-bottom: 24px;
}

.hero__cta-wrap {
  margin-bottom: 24px;
}

.hero__media {
  position: relative;
}

.hero__media img {
  width: 100%;
  margin-bottom: 24px;
}

.hero__rule {
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: var(--sm-stroke);
}

.hero-avatar,
.hero-carousel {
  display: none;
}

/* ElevatedButton(main, squircle 8) */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--sm-main);
  color: #fff;
  border-radius: var(--sm-corner-radius);
  padding: 16px;
  transition: filter 150ms ease, transform 150ms ease;
}

.btn-primary:hover {
  filter: brightness(1.08);
}

.btn-primary:active {
  transform: scale(0.98);
}

.btn-primary img {
  width: 24px;
  height: 24px;
}

/* --------------------------------------------------------------------------
   7. Hero — desktop overrides (>= 1080px), applied at the end of the file
   -------------------------------------------------------------------------- */

@keyframes sm-hero-rise {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: none; }
}

@keyframes sm-hero-pop {
  from { opacity: 0; transform: scale(0); }
  to { opacity: 1; transform: scale(1); }
}

@keyframes sm-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Floating avatar pairs — Positioned(right/top) inside the 1048px content box.
   Three nested layers so the pop, the bob and the hover shift can coexist. */
.hero-avatar {
  /* display comes from the 1080px block — this is desktop-only furniture */
  position: absolute;
  width: 250px;
  height: 112px;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.hero-avatar--presto {
  right: 80px;
  top: 50px;
}

.hero-avatar--min {
  right: 120px;
  top: 190px;
}

.hero-avatar__bob {
  display: flex;
  align-items: center;
  animation: sm-bob-10 8s var(--sm-ease-in-out-sine) infinite;
}

.hero-avatar--min .hero-avatar__bob { animation-delay: 1.5s; }

.hero-avatar:hover .hero-avatar__bob {
  animation-play-state: paused;
}

.hero-avatar__row {
  display: flex;
  align-items: center;
  gap: var(--sm-gap);
  transition: transform 300ms ease-out, gap 300ms ease-out;
}

.hero-avatar:hover .hero-avatar__row {
  gap: 24px;
}

.hero-avatar--min:hover .hero-avatar__row {
  transform: translateX(12px);
}

.hero-avatar__name,
.hero-avatar__face {
  height: 72px;
  width: auto;
}

.hero-avatar__face {
  transition: transform 300ms var(--sm-ease-out-back);
}

.hero-avatar:hover .hero-avatar__face {
  transform: scale(1.15);
}

@keyframes sm-bob-10 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(10px); }
}

/* Carousel band */
.hero-carousel {
  position: relative;
  margin-top: 80px;
  padding-bottom: 12px;
}

/* The gradient and the rule sit *behind* the strip, matching the Stack
   order in hero_desktop.dart (carousel is the last, topmost child). */
.hero-carousel__fade {
  position: absolute;
  inset: auto 0 0 0;
  height: 270px;
  pointer-events: none;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    var(--sm-bg-1) 100%
  );
  z-index: 0;
}

.hero-carousel__rule {
  position: absolute;
  inset: auto 0 0 0;
  height: 1px;
  background: var(--sm-stroke);
  z-index: 1;
}

.hero-carousel__viewport {
  position: relative;
  z-index: 2;
  height: 420px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-behavior: auto !important;
  cursor: grab;
}

.hero-carousel__viewport::-webkit-scrollbar {
  display: none;
}

.hero-carousel__viewport.is-dragging {
  cursor: grabbing;
}

.hero-carousel__track {
  display: flex;
  gap: 10px;
  width: max-content;
  padding-block: 20px;
}

.hero-carousel__item {
  height: 380px;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.06);
  flex: none;
}

.hero-carousel__item img {
  height: 380px;
  width: auto;
  max-width: none;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
}

/* DesktopHeroLayout takes over at the 1080px breakpoint from
   hero_section.dart. Below it, MobileHeroLayout has no entrance animation,
   so the staggered timeline lives in here too. */
@media (min-width: 1080px) {
  .hero { padding-top: 140px; } /* 72 nav height + spacing */

  .hero__inner {
    max-width: var(--sm-content-width);
    margin-inline: auto;
    padding-inline: var(--sm-app-margin);
  }

  .hero__headline,
  .hero__desc,
  .hero__cta-wrap {
    padding-inline: 0;
  }

  .hero__headline {
    font-size: 40px;
    margin-bottom: var(--sm-section-spacing);
  }

  .hero__desc {
    font-size: 18px;
    max-width: 600px;
    margin-bottom: 40px;
  }

  .hero__cta-wrap { margin-bottom: 0; }
  .hero__cta-wrap .btn-primary { padding: 20px 32px; }

  .hero__media { display: none; }

  .hero-avatar { display: flex; }
  .hero-carousel { display: block; }

  /* Staggered entrance — AnimationController(1600ms) with Interval starts
     of 0.0 / 0.15 / 0.3 / 0.45, each running 0.4 of the timeline (640ms). */
  .js .hero__headline {
    animation: sm-hero-rise 640ms var(--sm-ease-out-quart) both;
  }

  .js .hero__desc {
    animation: sm-hero-rise 640ms var(--sm-ease-out-quart) 240ms both;
  }

  .js .hero__cta-wrap .btn-primary {
    animation: sm-hero-rise 640ms var(--sm-ease-out-quart) 480ms both;
  }

  .js .hero-avatar {
    animation: sm-hero-pop 560ms var(--sm-ease-out-back) 720ms both;
  }

  .js .hero-carousel {
    animation: sm-fade-in 640ms ease-out 720ms both;
  }
}

/* --------------------------------------------------------------------------
   8. Brands
   -------------------------------------------------------------------------- */

.brands {
  width: 100%;
  background: var(--sm-bg-white);
  border-bottom: 1px solid var(--sm-stroke);
  padding-block: 32px;
  overflow: hidden;
}

.brands__title {
  color: var(--sm-text-primary);
  text-align: center;
  margin-bottom: 24px;
}

.brands__marquee {
  height: 80px;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 6%,
    #000 94%,
    transparent
  );
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 6%,
    #000 94%,
    transparent
  );
}

.brands__track {
  display: flex;
  align-items: center;
  width: max-content;
  /* ~30px/sec, matching the 0.5px-per-frame ticker */
  animation: sm-marquee var(--sm-marquee-duration, 48s) linear infinite;
}

/* margin rather than gap, so one third of the track is an exact loop */
.brands__track img {
  height: 80px;
  width: auto;
  max-width: none;
  object-fit: contain;
  opacity: 0.8;
  flex: none;
  margin-right: 32px;
}

@keyframes sm-marquee {
  from { transform: translateX(0); }
  to { transform: translateX(calc(-100% / 3)); }
}

.brands__static {
  display: none;
  justify-content: center;
  align-items: center;
}

.brands__static img {
  height: 90px;
  width: auto;
  max-width: none;
  object-fit: contain;
  opacity: 0.8;
  margin-inline: 12px;
}

@media (min-width: 800px) {
  .brands { padding-block: 56px; }
  .brands__title { margin-bottom: 48px; }
}

@media (min-width: 1500px) {
  .brands__marquee { display: none; }
  .brands__static { display: flex; }
}

/* --------------------------------------------------------------------------
   9. Difference
   -------------------------------------------------------------------------- */

.difference {
  position: relative;
  width: 100%;
  background: var(--sm-bg-white);
  padding-block: 44px;
  overflow: hidden;
}

/* ImageFiltered(blur 80) over an elliptical softPurpleWhite shape */
.difference__eclipse {
  position: absolute;
  left: -200px;
  right: -200px;
  bottom: -120px;
  height: 240px;
  background: var(--sm-soft-purple-white);
  border-radius: 1500px / 240px;
  filter: blur(80px);
  pointer-events: none;
}

.difference__inner {
  position: relative;
  max-width: var(--sm-content-width);
  margin-inline: auto;
}

.difference__headline {
  color: var(--sm-text-primary);
  padding-inline: 20px;
  margin-bottom: 40px;
}

.difference__items {
  padding-inline: 20px;
}

.difference-item__title {
  color: var(--sm-text-primary);
  margin-bottom: 6px;
}

.difference-item__body {
  color: var(--sm-text-secondary);
  line-height: 1.5;
}

.difference__rule {
  height: 1px;
  margin-block: 32px;
  border: 0;
  background: linear-gradient(
    to right,
    var(--sm-stroke),
    rgba(230, 230, 230, 0)
  );
}

/* Bobbing cards — three layers so the loop, the tilt and the placement
   each own their own transform */
.diff-card {
  position: absolute;
}

.diff-card__bob {
  animation: sm-bob-15 8s var(--sm-ease-in-out-sine) infinite;
  animation-delay: var(--bob-delay, 0ms);
}

.diff-card__inner {
  display: block;
  transition: transform 200ms var(--sm-ease-out-back),
    filter 200ms var(--sm-ease-out-back);
  transform: rotate(var(--angle, 0deg));
  filter: drop-shadow(0 10px 20px rgba(0, 0, 0, 0.1));
}

.diff-card:hover .diff-card__inner {
  transform: rotate(var(--angle-hover, 0deg)) scale(1.1);
  filter: drop-shadow(0 20px 30px rgba(0, 0, 0, 0.2));
}

@keyframes sm-bob-15 {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(15px); }
}

.diff-plus {
  position: absolute;
  width: 24px;
  height: 24px;
}

/* Mobile: three cards side by side inside a 300x200 box */
.diff-cards-h {
  position: relative;
  width: 300px;
  height: 200px;
  margin: 0 auto 48px;
}

.diff-cards-h .diff-card { width: 110px; }
.diff-cards-h .diff-plus { width: 16px; height: 16px; }

/* Desktop: vertical stack, horizontally centred, inside a 600px column */
.diff-cards-v {
  display: none;
  position: relative;
  height: 600px;
  margin-top: 80px;
}

.diff-cards-v .diff-card {
  width: 170px;
  left: 50%;
  margin-left: calc(-85px + var(--nudge-x, 0px));
}

.diff-cards-v .diff-plus {
  left: 50%;
  margin-left: calc(-12px + var(--nudge-x, 0px));
}

@media (min-width: 900px) {
  .difference { padding-block: 64px; }

  .difference__inner {
    display: flex;
    align-items: center;
    gap: 40px;
    padding-inline: var(--sm-app-margin);
  }

  .difference__col-text,
  .difference__col-cards {
    flex: 1 1 0;
    min-width: 0;
  }

  .difference__headline {
    padding-inline: 0;
    margin-bottom: 80px;
  }

  .difference__items { padding-inline: 0; }

  .diff-cards-h { display: none; }
  .diff-cards-v { display: block; }
}

/* --------------------------------------------------------------------------
   10. Showcase
   -------------------------------------------------------------------------- */

.showcase {
  width: 100%;
  background: var(--sm-soft-purple-white);
  overflow: hidden;
}

.showcase__inner {
  max-width: var(--sm-content-width);
  margin-inline: auto;
  padding-block: 44px;
}

.showcase__headline {
  color: var(--sm-text-primary);
  padding-inline: 20px;
  margin-bottom: 32px;
}

.showcase__list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-inline: 12px;
  margin-bottom: 40px;
}

@media (min-width: 900px) {
  .showcase__inner { padding-block: 100px; }

  .showcase__headline {
    padding-inline: var(--sm-app-margin);
    margin-bottom: 60px;
  }

  .showcase__list {
    gap: 20px;
    padding-inline: var(--sm-app-margin);
    margin-bottom: 100px;
  }
}

/* --- Showcase card ------------------------------------------------------- */

.sc-card {
  position: relative;
  border: 1px solid var(--sm-stroke);
  border-radius: 12px;
  overflow: hidden;
  background: var(--sc-bg);
  transition: border-color 500ms var(--sm-ease-out-quart);
}

.sc-card:hover {
  border-color: var(--sc-border-hover);
}

.sc-card__eclipse {
  position: absolute;
  left: -300px;
  right: -300px;
  top: var(--eclipse-top-mobile, 0px);
  height: 400px;
  background: var(--sc-eclipse-mobile, var(--sc-eclipse));
  border-radius: 2000px;
  filter: blur(80px);
  pointer-events: none;
  z-index: 1;
}

.sc-card__media {
  position: absolute;
  inset: auto 0 0 0;
  height: 280px;
  z-index: 0;
  overflow: hidden;
}

.sc-card__media > span {
  display: block;
  height: 100%;
  width: 100%;
  overflow: hidden;
}

.sc-card__media img {
  height: 100%;
  width: 100%;
  object-fit: cover;
  object-position: 50% var(--pan-y, 50%);
  transition: transform 500ms var(--sm-ease-out-quart);
  /* PanningImage: a slow left/right drift, reversing (30s or 35s each way) */
  animation: sm-pan var(--pan-duration, 60s) var(--sm-ease-in-out-sine) infinite
    alternate;
}

@keyframes sm-pan {
  from { object-position: 0% var(--pan-y, 50%); }
  to { object-position: 100% var(--pan-y, 50%); }
}

.sc-card:hover .sc-card__media img {
  transform: scale(1.05);
}

.sc-card__body {
  position: relative;
  z-index: 2;
  padding: 24px;
  color: #fff;
}

.sc-card--light .sc-card__body { color: var(--sm-text-primary); }

.sc-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.sc-card__logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.sc-card__rule {
  height: 1px;
  margin-block: 24px;
  border: 0;
  background: linear-gradient(
    to right,
    var(--sc-rule, rgba(255, 255, 255, 0.2)),
    rgba(255, 255, 255, 0)
  );
}

.sc-card--light {
  --sc-rule: rgba(26, 26, 26, 0.2);
}

.sc-card--light .sc-card__rule {
  background: linear-gradient(
    to right,
    rgba(26, 26, 26, 0.2),
    rgba(26, 26, 26, 0)
  );
}

.sc-card__desc { margin-bottom: 12px; }

.sc-card__points {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sc-card__point {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  line-height: 1.5;
}

.sc-card__point img {
  width: 24px;
  height: 24px;
  margin-top: 4px;
  flex: none;
}

.sc-card__spacer { height: 280px; }

.sc-card__cta { margin-top: 12px; }

/* Platform icons */
.platform-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.platform-icons svg {
  width: 20px;
  height: 20px;
  display: block;
  color: var(--sc-icon, rgba(255, 255, 255, 0.55));
  transition: color 150ms ease, transform 150ms ease;
}

.platform-icons a:hover svg,
.platform-icons span:hover svg {
  color: var(--sc-icon-hover, #fff);
  transform: scale(1.1);
}

.sc-card--light {
  --sc-icon: rgba(0, 0, 0, 0.54);
  --sc-icon-hover: #000;
}

/* Bordered link button (HoverLinkButton) */
.link-btn {
  display: inline-block;
  padding: 10px 16px;
  border: 2px solid var(--lb-border, #fff);
  border-radius: var(--sm-corner-radius);
  color: var(--lb-fg, #fff);
  background: transparent;
  transition: background-color 120ms ease, color 120ms ease;
}

.link-btn:hover {
  background: var(--lb-border, #fff);
  color: var(--lb-bg-fg, var(--sm-text-primary));
}

.sc-card--light .link-btn {
  --lb-border: #000;
  --lb-fg: var(--sm-text-primary);
  --lb-bg-fg: #fff;
}

/* Desktop split layout: 5/13 content column, 8/13 + 80 media column */
@media (min-width: 900px) {
  .sc-card__body {
    width: calc(1080px * 5 / 13);
    padding: 60px; /* 12 outer + 48 inner */
  }

  .sc-card__spacer { display: none; }

  .sc-card__media {
    top: 0;
    bottom: 0;
    inset-inline: auto;
    height: auto;
    width: calc((1080px * 8 / 13) + 80px);
    padding: 12px;
  }

  .sc-card__media > span {
    border-radius: var(--sm-corner-radius);
  }

  .sc-card--media-right .sc-card__media { right: 0; }
  .sc-card--media-left .sc-card__media { left: 0; }
  .sc-card--media-left .sc-card__body { margin-left: auto; }

  .sc-card__eclipse {
    top: -600px;
    bottom: -600px;
    left: auto;
    right: auto;
    height: auto;
    width: 1000px;
    filter: blur(100px);
    background: var(--sc-eclipse);
  }

  .sc-card--media-right .sc-card__eclipse { left: -380px; }
  .sc-card--media-left .sc-card__eclipse { right: -380px; }

  .sc-card__logo { height: 56px; }
  .sc-card__logo--timeless { height: 72px; }
  .sc-card__logo--sithar { height: 80px; }

  .sc-card__head {
    display: block;
  }

  .sc-card__head .platform-icons {
    margin-top: 12px;
    gap: 12px;
  }
}

@media (max-width: 899.98px) {
  .sc-card__logo--timeless { height: 56px; }
  .sc-card__logo--sithar { height: 64px; }
  .sc-card__cta { display: none; }
}

/* --- Track record -------------------------------------------------------- */

/* The copy sits at 20px (16px on desktop); the grid at 12px (16px). */
.track__title,
.track__body {
  padding-inline: 20px;
  color: var(--sm-text-primary);
}

.track__title { margin-bottom: 16px; }
.track__body { margin-bottom: 32px; }

/* Rows overlap by 30% of an image's height; an image is 2.16x its column
   width, so the whole grid's aspect ratio is fixed and every offset below
   can be expressed as a percentage of it. */
.track__grid {
  position: relative;
}

.track__row {
  position: absolute;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
}

.track__cell {
  padding-inline: 4px;
  transition: transform 300ms var(--sm-ease-out-quart);
}

.track__cell:hover { transform: translateY(-16px); }

.track__shader {
  position: absolute;
  left: 0;
  right: 0;
  pointer-events: none;
  background: linear-gradient(
    to top,
    var(--sm-soft-purple-white) 70%,
    rgba(255, 255, 255, 0) 100%
  );
}

/* Mobile: 3 rows of 3 */
.track__grid--desktop { display: none; }

.track__grid--mobile {
  aspect-ratio: 1 / 1.728;
  margin-inline: 12px;
}

.track__grid--mobile .track__cell { width: calc(100% / 3); }
.track__grid--mobile .track__row--1 { top: 0; }
.track__grid--mobile .track__row--2 { top: 29.17%; }
.track__grid--mobile .track__row--3 { top: 58.33%; }
.track__grid--mobile .track__shader { height: 20.83%; }
.track__grid--mobile .track__shader--1 { top: 22.92%; }
.track__grid--mobile .track__shader--2 { top: 52.08%; }

/* Desktop: 2 rows of 4 */
.track__grid--desktop {
  aspect-ratio: 1 / 0.918;
  margin-inline: var(--sm-app-margin);
}

.track__grid--desktop .track__cell { width: 25%; }
.track__grid--desktop .track__row--1 { top: 0; }
.track__grid--desktop .track__row--2 { top: 41.18%; }
.track__grid--desktop .track__shader { height: 29.41%; }
.track__grid--desktop .track__shader--1 { top: 32.35%; }

@media (min-width: 900px) {
  .track__title,
  .track__body { padding-inline: var(--sm-app-margin); }

  .track__body { margin-bottom: 40px; }

  .track__grid--mobile { display: none; }
  .track__grid--desktop { display: block; }
}

/* --------------------------------------------------------------------------
   11. Services
   -------------------------------------------------------------------------- */

.services {
  background: var(--sm-bg-white);
  border-top: 1px solid var(--sm-stroke);
  padding-block: 44px;
}

.services__title {
  color: var(--sm-text-primary);
  margin-bottom: 24px;
}

.services-row {
  display: flex;
  flex-direction: column;
  gap: 20px;
  margin-bottom: 56px;
}

.service-card {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid var(--sm-stroke);
  border-radius: 14px;
  background: #f9f9f9;
  --fg: var(--sm-text-primary);
  --sub: var(--sm-text-secondary);
  --div: var(--sm-stroke);
}

.service-card__overlay {
  position: absolute;
  inset: -1px;
  border-radius: 14px;
  background: linear-gradient(to bottom, var(--g-from), var(--g-to));
  opacity: 0;
  transition: opacity 500ms ease-out;
  pointer-events: none;
}

.service-card.is-active { --fg: #fff; --sub: #fff; --div: #fff; }
.service-card.is-active .service-card__overlay { opacity: 1; }

.service-card__body {
  position: relative;
  z-index: 1;
  padding: 24px;
}

.service-card__art {
  aspect-ratio: 1;
  padding: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-card__art img {
  width: 80%;
  height: 80%;
  object-fit: contain;
  animation: sm-float 4.6s var(--sm-ease-in-out-sine) infinite;
}

.service-card:nth-child(2) .service-card__art img { animation-duration: 5.2s; animation-delay: -1.4s; }
.service-card:nth-child(3) .service-card__art img { animation-duration: 5.8s; animation-delay: -2.6s; }

@keyframes sm-float {
  0%, 100% { transform: translateY(-5px); }
  50% { transform: translateY(5px); }
}

.service-card__title {
  color: var(--fg);
  transition: color 500ms ease-out;
  margin-bottom: 4px;
}

.service-card__subtitle {
  color: var(--sub);
  transition: color 500ms ease-out;
  margin-bottom: 16px;
}

.service-card__divider {
  height: 1px;
  border: 0;
  margin: 0 0 16px;
  background: var(--div);
  transition: background-color 500ms ease-out;
}

.service-card__item {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
  color: var(--fg);
  line-height: 1.3;
  transition: color 500ms ease-out;
}

.service-card__bullet {
  width: 6px;
  height: 6px;
  flex: none;
  margin: 8px 12px 0 0;
  border-radius: 50%;
  background: var(--sm-bg-2);
  border: 1px solid var(--sm-stroke);
}

/* Fit / not-fit comparison */
.fit {
  display: flex;
  flex-direction: column;
}

.fit__card {
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
  padding: 48px 32px;
  margin-bottom: 48px;
}

.fit__plain {
  padding: 16px 32px;
}

.fit__art {
  height: 85px;
  width: auto;
  object-fit: contain;
  margin-bottom: 24px;
}

.fit__title {
  font-size: 22px;
  font-weight: 800;
  letter-spacing: var(--sm-title-tracking);
  color: var(--sm-text-primary);
  margin-bottom: 16px;
}

.fit__title--muted { color: var(--sm-text-secondary); }

.fit__list li {
  display: flex;
  align-items: flex-start;
  margin-bottom: 8px;
}

.fit__list li::before {
  content: "•";
  color: var(--sm-text-secondary);
  margin-right: 8px;
}

.fit__list--muted { color: var(--sm-text-secondary); }
.fit__list--strong { color: var(--sm-text-primary); }

@media (min-width: 900px) {
  .services { padding-block: 120px; }

  .services-row {
    flex-direction: row;
    margin-bottom: 64px;
  }

  .service-card__item,
  .service-card__subtitle { font-size: 16px; }

  .fit {
    flex-direction: row;
    align-items: flex-start;
    gap: 40px;
  }

  /* Expanded(flex: 3) / Expanded(flex: 2) split the full track, so the
     widths are set outright — flex-basis:0 on a border-box element would
     floor at the horizontal padding and skew the ratio. */
  .fit__card {
    flex: none;
    width: calc((100% - 40px) * 3 / 5);
    padding: 64px 40px;
    margin-bottom: 0;
  }

  .fit__plain {
    flex: none;
    width: calc((100% - 40px) * 2 / 5);
    padding: 64px 40px;
  }

  .fit__art {
    height: 100px;
    margin-bottom: 32px;
  }

  .fit__title {
    font-size: 24px;
    margin-bottom: 24px;
  }

  /* First card is active by default; hovering the row moves the highlight */
  .services-row > .service-card:first-child { --fg: #fff; --sub: #fff; --div: #fff; }
  .services-row > .service-card:first-child .service-card__overlay { opacity: 1; }

  .services-row:hover > .service-card:first-child {
    --fg: var(--sm-text-primary);
    --sub: var(--sm-text-secondary);
    --div: var(--sm-stroke);
  }
  .services-row:hover > .service-card:first-child .service-card__overlay { opacity: 0; }

  .services-row:hover > .service-card:hover { --fg: #fff; --sub: #fff; --div: #fff; }
  .services-row:hover > .service-card:hover .service-card__overlay { opacity: 1; }
}

/* --------------------------------------------------------------------------
   12. CTA
   -------------------------------------------------------------------------- */

.cta {
  position: relative;
  background: var(--sm-bg-1);
  border-top: 1px solid var(--sm-stroke);
  padding-block: 44px;
  overflow: hidden;
}

.cta__eclipse {
  position: absolute;
  left: -200px;
  right: -200px;
  top: -120px;
  height: 240px;
  background: #fff;
  border-radius: 1500px / 240px;
  filter: blur(80px);
  pointer-events: none;
}

.cta__wrap {
  width: 100%;
}

.cta__inner {
  position: relative;
  z-index: 1;
}

.cta__header {
  padding-inline: 20px;
  margin-bottom: 48px;
}

.cta__title {
  color: var(--sm-text-primary);
  margin-bottom: 24px;
}

.cta__desc {
  color: var(--sm-text-secondary);
  line-height: 1.6;
  margin-bottom: 32px;
}

.cta__social-label {
  color: var(--sm-text-secondary);
  margin-bottom: 16px;
}

.cta__socials {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.cta__socials a {
  color: var(--sm-text-primary);
  transition: color 200ms ease, transform 200ms ease;
  display: inline-flex;
}

.cta__socials a:hover {
  color: var(--sm-main);
  transform: scale(1.1);
}

.cta__socials svg {
  width: 24px;
  height: 24px;
  display: block;
}

.cta__form-wrap { padding-inline: 16px; }

.cta-form {
  padding: 16px;
  border-radius: 14px;
  background: rgba(220, 210, 255, 0.1);
  border: 1px solid rgba(123, 97, 255, 0.15);
}

.cta-form__label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--sm-text-primary);
  margin-bottom: 12px;
}

.cta-form__label svg {
  width: 20px;
  height: 20px;
}

/* The lined-paper textarea from _LinedPaperPainter: rules every 32px */
.cta-form__idea {
  display: block;
  width: 100%;
  height: 192px; /* 6 lines x 32px */
  border: 0;
  padding: 0;
  resize: none;
  background-color: transparent;
  background-image: repeating-linear-gradient(
    to bottom,
    var(--sm-stroke) 0 1px,
    transparent 1px 32px
  );
  background-position: 0 31px;
  background-size: 100% 160px;
  background-repeat: no-repeat;
  font-size: 16px;
  line-height: 32px;
  color: var(--sm-text-primary);
  caret-color: var(--sm-text-primary);
}

.cta-form__idea:focus { outline: none; }
.cta-form__idea::placeholder { color: var(--sm-text-disabled); }

.cta-form__foot {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  margin-top: 24px;
}

.cta-form__email-col {
  flex: 1 1 auto;
  min-width: 0;
}

.cta-form__email-col .cta-form__label { margin-bottom: 4px; }

.cta-form__email {
  display: block;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--sm-stroke);
  border-radius: 0;
  background: transparent;
  padding-block: 8px;
  font-size: 16px;
  transition: border-color 150ms ease;
}

.cta-form__email:focus {
  outline: none;
  border-bottom-color: var(--sm-text-primary);
}

.cta-form__email::placeholder { color: var(--sm-text-disabled); }

.cta-form__send {
  flex: none;
  padding: 20px 32px;
  border-radius: var(--sm-corner-radius);
  background: var(--sm-main);
  color: #fff;
  font-weight: 700;
  border: 1px solid transparent;
  transition: filter 150ms ease, background-color 200ms ease,
    color 200ms ease, border-color 200ms ease;
}

.cta-form__send:hover:not(:disabled) { filter: brightness(1.08); }

.cta-form__send:disabled {
  background: var(--sm-bg-2);
  color: var(--sm-text-disabled);
  border-color: var(--sm-stroke);
  cursor: not-allowed;
}

.cta-form__errors {
  margin-top: 12px;
  color: var(--sm-error);
  font-size: 13px;
}

@media (min-width: 900px) {
  .cta { padding-block: 120px; }

  .cta__wrap {
    width: min(var(--sm-content-width), 100% - (2 * var(--sm-app-margin)));
    margin-inline: auto;
  }

  .cta__inner {
    display: flex;
    align-items: flex-start;
    gap: 80px;
  }

  .cta__header {
    flex: 3 1 0;
    min-width: 0;
    padding-inline: 0;
    margin-bottom: 0;
  }

  .cta__form-wrap {
    flex: 5 1 0;
    min-width: 0;
    padding-inline: 0;
  }

  .cta-form {
    padding: 32px;
    border-radius: 24px;
  }
}

/* --------------------------------------------------------------------------
   13. Footer
   -------------------------------------------------------------------------- */

.footer {
  background: var(--sm-bg-white);
  border-top: 1px solid #eeeeee;
}

.footer__inner {
  padding-block: 32px;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 12px;
  color: var(--sm-text-secondary);
}

.footer__credit {
  display: flex;
  align-items: center;
}

.footer__credit a {
  transition: font-weight 100ms ease;
}

.footer__credit a:hover { font-weight: 700; }

.footer__avatars {
  position: relative;
  width: 38px;
  height: 24px;
  margin-left: 12px;
  flex: none;
}

.footer__avatars img {
  position: absolute;
  top: 0;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid #fff;
  object-fit: cover;
}

.footer__avatars img:nth-child(1) { left: 14px; }
.footer__avatars img:nth-child(2) { left: 0; }

@media (min-width: 900px) {
  .footer__inner {
    flex-direction: row;
    justify-content: space-between;
    height: 56px;
    padding-block: 0;
  }
}

/* --------------------------------------------------------------------------
   14. Scroll-reveal + toast
   -------------------------------------------------------------------------- */

/* Scoped to .js so the server-rendered content is visible to crawlers and
   to anyone whose scripts fail — the animation is an enhancement only. */
.js .reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 800ms var(--sm-ease-out-quart),
    transform 800ms var(--sm-ease-out-quart);
  transition-delay: var(--reveal-delay, 0ms);
}

.js .reveal--scale { transform: translateY(30px) scale(0.95); }
.js .reveal--soft { transform: translateY(50px); filter: blur(10px); }

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
  filter: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  transform: translate(-50%, 24px);
  z-index: 300;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: min(520px, calc(100vw - 32px));
  padding: 14px 20px;
  border-radius: var(--sm-corner-radius);
  background: var(--sm-success);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: var(--sm-title-tracking);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
  opacity: 0;
  pointer-events: none;
  transition: opacity 250ms ease, transform 250ms ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast--error { background: #ff5252; }

.toast svg {
  width: 20px;
  height: 20px;
  flex: none;
}

/* --------------------------------------------------------------------------
   15. Reduced motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }

  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
    filter: none;
  }
}
