/**
 * Masaha Features - Frontend Styles
 * Mobile-first. All selectors prefixed with .msf- to avoid collisions.
 */

:root {
    --msf-bg-light: #183764;
    --msf-bg-dark: #0e213d;
    --msf-gold: #ffd466;
    --msf-text: #ffffff;

    --msf-label-size: 20px;
    --msf-sublabel-size: 13px;
    --msf-hero-label-size: 28px;
    --msf-hero-sublabel-size: 15px;

    --msf-home-padding: 0;
    --msf-home-margin: 20px auto;
    --msf-home-gap: 14px;

    --msf-services-padding: 0 14px;
    --msf-services-margin: 24px auto;
    --msf-services-gap: 18px;
}

/* =========================================================
 * Shared icon
 * ======================================================= */
.msf-icon {
    position: relative;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.4));
    opacity: 0.95;
}

.msf-svg {
    width: 100%;
    height: 90%;
    overflow: visible;
}

.msf-blade {
    fill: var(--msf-gold);
    transform-origin: 18px 19px;
}

.msf-blade-top    { animation: msfSnipTop 3s ease-in-out infinite; }
.msf-blade-bottom { animation: msfSnipBottom 3s ease-in-out infinite; }
.msf-thread       { stroke-dasharray: 2.5 2; animation: msfThreadFlow 2.2s linear infinite; }

@keyframes msfSnipTop    { 0%,100% { transform: rotate(0deg); } 50% { transform: rotate(-8deg); } }
@keyframes msfSnipBottom { 0%,100% { transform: rotate(0deg); } 50% { transform: rotate(8deg); } }
@keyframes msfThreadFlow { 0% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -18; } }

/* Running stitch — makes the dashed stitch line "sew" along the card */
@keyframes msfStitchWalk { 0% { background-position: 0 0; } 100% { background-position: -28px 0; } }

/* Traveling scissors — tiny pair of scissors walks along the stitch line */
@keyframes msfStitchScissors {
    0%   { right: -22px; opacity: 0; }
    8%   { opacity: 1; }
    92%  { opacity: 1; }
    100% { right: calc(100% + 22px); opacity: 0; }
}

/* Silk shimmer — diagonal light sweep every few seconds */
@keyframes msfShimmer {
    0%   { transform: translateX(-160%) skewX(-18deg); opacity: 0; }
    35%  { opacity: 1; }
    60%  { transform: translateX(160%) skewX(-18deg); opacity: 0; }
    100% { transform: translateX(160%) skewX(-18deg); opacity: 0; }
}

/* Icon halo pulse */
@keyframes msfGlowPulse {
    0%, 100% { opacity: 0.35; transform: scale(1); }
    50%      { opacity: 0.75; transform: scale(1.12); }
}

/* Button-style tap ripple press cue (runs once on :active) */
@keyframes msfPressFlash {
    0%   { opacity: 0; }
    40%  { opacity: 1; }
    100% { opacity: 0; }
}

/* =========================================================
 * Shortcode 1 — Homepage: hero + 2 mini cards
 * ======================================================= */
.msf-home-wrap {
    display: flex;
    flex-direction: column;
    gap: var(--msf-home-gap);
    width: 100%;
    max-width: 450px;
    margin: var(--msf-home-margin);
    padding: var(--msf-home-padding);
    box-sizing: border-box;
    font-family: system-ui, -apple-system, sans-serif;
}

/* ---- Hero (Feature 1) ---- */
.msf-home-hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;

    width: 100%;
    height: 91px;

    background: linear-gradient(135deg, var(--msf-bg-light), var(--msf-bg-dark));
    border-radius: 18px;
    color: var(--msf-text);
    border: 1px solid rgba(255, 212, 102, 0.22);

    /* Raised button shadow (double-layer for 3D feel) */
    box-shadow:
        0 8px 18px rgba(0, 0, 0, 0.32),
        0 2px 4px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);

    overflow: hidden;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 212, 102, 0.25);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.msf-home-hero:hover,
.msf-home-hero:focus {
    transform: translateY(-2px);
    box-shadow:
        0 12px 26px rgba(0, 0, 0, 0.42),
        0 2px 4px rgba(0, 0, 0, 0.18),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    color: var(--msf-text);
    text-decoration: none;
}
/* Pressed state — the card depresses like a real button */
.msf-home-hero:active {
    transform: translateY(1px) scale(0.985);
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.35),
        inset 0 2px 6px rgba(0, 0, 0, 0.25);
    color: var(--msf-text);
    text-decoration: none;
    transition-duration: 0.06s;
}

.msf-hero-text {
    position: relative;
    z-index: 4;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* Mini-card text sits above the stitch/halo layers */
.msf-home-mini .msf-mini-label,
.msf-home-mini .msf-mini-sublabel {
    position: relative;
    z-index: 2;
}
.msf-service-text {
    z-index: 3 !important;
}
.msf-hero-label {
    font-size: var(--msf-hero-label-size) !important;
    font-weight: 800;
    color: var(--msf-text);
    line-height: 1.2;
    margin-bottom: 4px;
}
.msf-hero-sublabel {
    font-size: var(--msf-hero-sublabel-size) !important;
    opacity: 0.82;
    font-weight: 400;
    color: var(--msf-text);
}

.msf-stitch-track {
    position: absolute;
    bottom: 15px;
    left: 0;
    width: 100%;
    height: 2px;
    opacity: 0.4;
    background-image: linear-gradient(to right, var(--msf-gold) 50%, transparent 50%);
    background-size: 14px 100%;
    background-repeat: repeat-x;
    pointer-events: none;
    animation: msfStitchWalk 2.2s linear infinite;
}

/* Traveling scissors (hero only) — walks along the stitch line,
   flipped so it "faces" the direction of travel. Blades snip while walking. */
.msf-stitch-scissors {
    position: absolute;
    bottom: 7px;
    right: -22px;
    width: 20px;
    height: 20px;
    opacity: 0;
    pointer-events: none;
    z-index: 3;
    transform: scaleX(-1);
    filter: drop-shadow(0 0 4px rgba(255, 212, 102, 0.55));
    animation: msfStitchScissors 12s linear infinite;
}
.msf-stitch-scissors svg {
    width: 100%;
    height: 100%;
    overflow: visible;
    display: block;
}

/* Silk shimmer sweep (hero & services) */
.msf-shimmer {
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(110deg,
        transparent 0%,
        rgba(255, 255, 255, 0.06) 30%,
        rgba(255, 212, 102, 0.18) 50%,
        rgba(255, 255, 255, 0.06) 70%,
        transparent 100%);
    transform: translateX(-160%) skewX(-18deg);
    pointer-events: none;
    z-index: 1;
    animation: msfShimmer 5.5s ease-in-out infinite;
    animation-delay: 1s;
}

.msf-icon-hero {
    position: absolute;
    left: 22px;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    z-index: 4;
}

/* ---- Duo row (Features 2 & 3) ---- */
.msf-home-duo {
    display: flex;
    flex-direction: row;
    gap: 12px;
    width: 100%;
}

.msf-home-mini {
    position: relative;
    flex: 1 1 0;
    min-width: 0;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0px;

    min-height: 120px;
    padding: 16px 12px;
    box-sizing: border-box;

    background: linear-gradient(135deg, var(--msf-bg-light), var(--msf-bg-dark));
    border-radius: 16px;
    color: var(--msf-text);
    border: 1px solid rgba(255, 212, 102, 0.18);

    /* Raised button shadow */
    box-shadow:
        0 6px 14px rgba(0, 0, 0, 0.28),
        0 1px 3px rgba(0, 0, 0, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.05);

    text-decoration: none;
    overflow: hidden;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 212, 102, 0.25);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.msf-home-mini:hover,
.msf-home-mini:focus {
    transform: translateY(-2px);
    box-shadow:
        0 10px 20px rgba(0, 0, 0, 0.38),
        0 1px 3px rgba(0, 0, 0, 0.16),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    color: var(--msf-text);
    text-decoration: none;
}
.msf-home-mini:active {
    transform: translateY(1px) scale(0.98);
    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.35),
        inset 0 2px 5px rgba(0, 0, 0, 0.25);
    color: var(--msf-text);
    text-decoration: none;
    transition-duration: 0.06s;
}

/* Icon glow halo behind the mini icon */
.msf-mini-icon-halo {
    position: relative;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 2px;
}
.msf-mini-icon-halo::before {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255, 212, 102, 0.35) 0%,
        rgba(255, 212, 102, 0.08) 55%,
        transparent 75%);
    animation: msfGlowPulse 2.6s ease-in-out infinite;
    z-index: 0;
    pointer-events: none;
}
.msf-mini-icon-halo .msf-icon {
    position: relative;
    z-index: 1;
}

.msf-icon-mini {
    width: 36px;
    height: 36px;
    margin-bottom: 2px;
}
.msf-mini-label {
    font-size: var(--msf-label-size) !important;
    font-weight: 700;
    color: var(--msf-text);
    line-height: 1.2;
    text-align: center;
}
.msf-mini-sublabel {
    font-size: var(--msf-sublabel-size) !important;
    opacity: 0.72;
    font-weight: 400;
    color: var(--msf-text);
    text-align: center;
    line-height: 1.35;
}

/* =========================================================
 * Shortcode 2 — Services page showcase cards
 * ======================================================= */
.msf-services-column {
    display: flex;
    flex-direction: column;
    gap: var(--msf-services-gap);
    width: 100%;
    max-width: 520px;
    margin: var(--msf-services-margin);
    padding: var(--msf-services-padding);
    font-family: system-ui, -apple-system, sans-serif;
    box-sizing: border-box;
}

.msf-service-card {
    position: relative;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 16px;

    width: 100%;
    min-height: 120px;
    padding: 18px 20px;
    box-sizing: border-box;

    background: linear-gradient(135deg, var(--msf-bg-light), var(--msf-bg-dark));
    border-radius: 20px;
    color: var(--msf-text);
    border: 1px solid rgba(255, 212, 102, 0.2);

    box-shadow:
        0 8px 22px rgba(0, 0, 0, 0.38),
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);

    text-decoration: none;
    overflow: hidden;
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255, 212, 102, 0.25);
    transition: transform 0.14s ease, box-shadow 0.14s ease, border-color 0.14s ease;
}

.msf-service-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at top right, rgba(255, 212, 102, 0.08), transparent 60%);
    pointer-events: none;
    z-index: 0;
}

.msf-service-card:hover,
.msf-service-card:focus {
    transform: translateY(-3px);
    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.52),
        0 2px 4px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 212, 102, 0.4);
    color: var(--msf-text);
    text-decoration: none;
}
.msf-service-card:active {
    transform: translateY(1px) scale(0.985);
    box-shadow:
        0 3px 8px rgba(0, 0, 0, 0.38),
        inset 0 2px 6px rgba(0, 0, 0, 0.3);
    color: var(--msf-text);
    text-decoration: none;
    transition-duration: 0.06s;
}

.msf-service-icon-wrap {
    flex: 0 0 auto;
    width: 68px;
    height: 68px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: radial-gradient(circle, rgba(255, 212, 102, 0.25) 0%, rgba(255, 212, 102, 0.05) 70%, transparent 100%);
    border: 1px solid rgba(255, 212, 102, 0.25);
    position: relative;
    z-index: 2;
}

/* Breathing halo behind the service-card icon */
.msf-service-icon-halo {
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle,
        rgba(255, 212, 102, 0.3) 0%,
        rgba(255, 212, 102, 0.08) 55%,
        transparent 75%);
    animation: msfGlowPulse 2.8s ease-in-out infinite;
    pointer-events: none;
    z-index: 0;
}
.msf-service-icon-wrap .msf-icon {
    position: relative;
    z-index: 2;
}

.msf-icon-services {
    width: 42px;
    height: 42px;
}

.msf-service-text {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: relative;
    z-index: 2;
    min-width: 0;
}
.msf-service-label {
    margin: 0;
    font-size: var(--msf-label-size) !important;
    font-weight: 800;
    line-height: 1.25;
    color: var(--msf-text);
}
.msf-service-sublabel {
    margin: 0;
    font-size: var(--msf-sublabel-size) !important;
    font-weight: 400;
    opacity: 0.78;
    color: var(--msf-text);
    line-height: 1.4;
}

.msf-service-chevron {
    flex: 0 0 auto;
    width: 14px;
    height: 22px;
    opacity: 0.6;
    margin-inline-start: auto;
    position: relative;
    z-index: 2;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.msf-service-chevron svg {
    width: 100%;
    height: 100%;
    display: block;
}
.msf-service-card:hover .msf-service-chevron,
.msf-service-card:active .msf-service-chevron {
    opacity: 1;
    transform: translateX(-3px);
}

/* =========================================================
 * Narrow phone tweaks
 * ======================================================= */
@media (max-width: 380px) {
    .msf-icon-hero           { left: 14px; width: 40px; height: 40px; }

    .msf-home-duo            { gap: 10px; }
    .msf-home-mini           { padding: 14px 8px; min-height: 110px; }
    .msf-icon-mini           { width: 32px; height: 32px; }

    .msf-service-card        { padding: 16px; gap: 12px; min-height: 110px; }
    .msf-service-icon-wrap   { width: 58px; height: 58px; }
    .msf-icon-services       { width: 36px; height: 36px; }
}
