/*
Theme Name: MadMac
Theme URI: https://madmac.app
Author: BeAppi
Author URI: https://beappi.com
Description: Bold, dark and slightly unhinged landing-page theme for MadMac — the macOS menu bar app that tracks how angry your Mac is. Ships with an auto-built home page, privacy policy, email capture and a "MadMac Customers" admin panel with CSV export.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: madmac
*/

/* ============================================================
   MadMac theme styles
   Loaded via wp_enqueue_style in functions.php with a version
   constant (MADMAC_VERSION) so the cache busts on every install.
   ============================================================ */

:root {
    --mm-bg:        #0a0a0c;
    --mm-bg-2:      #121216;
    --mm-card:      #17171c;
    --mm-border:    #26262e;
    --mm-text:      #f2f2f4;
    --mm-muted:     #9a9aa5;
    --mm-red:       #ff2d2d;
    --mm-orange:    #ff7a18;
    --mm-yellow:    #ffd23f;
    --mm-green:     #2ecc71;
    --mm-accent-gradient: linear-gradient(100deg, #ff7a18 0%, #ff2d2d 100%);
}

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
    background: var(--mm-bg);
    color: var(--mm-text);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--mm-orange); text-decoration: none; }
a:hover { color: var(--mm-red); }

img { max-width: 100%; height: auto; }

.mm-container {
    width: 100%;
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ---------- Typography ---------- */
h1, h2, h3 {
    line-height: 1.05;
    letter-spacing: -0.02em;
    margin: 0 0 0.4em;
    font-weight: 900;
}
h1 { font-size: clamp(2.6rem, 6vw, 4.8rem); }
h2 { font-size: clamp(2rem, 4vw, 3rem); }
h3 { font-size: 1.4rem; }

.mm-eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 0.78rem;
    font-weight: 800;
    color: var(--mm-orange);
    margin-bottom: 1rem;
}

.mm-gradient-text {
    background: var(--mm-accent-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ---------- Header / nav ---------- */
.mm-site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(10,10,12,0.82);
    backdrop-filter: saturate(160%) blur(12px);
    border-bottom: 1px solid var(--mm-border);
}
.mm-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 68px;
}
.mm-logo {
    font-weight: 900;
    font-size: 1.4rem;
    letter-spacing: -0.03em;
    color: var(--mm-text);
    display: flex;
    align-items: center;
    gap: 8px;
}
.mm-logo .mm-logo-mark { display: block; filter: drop-shadow(0 0 8px rgba(255,45,45,0.45)); }
.mm-footer-brand { display: flex; align-items: center; gap: 10px; }
.mm-footer-brand .mm-logo-mark { flex: 0 0 auto; }
.mm-nav-cta {
    background: var(--mm-accent-gradient);
    color: #fff;
    padding: 10px 20px;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.95rem;
}
.mm-nav-cta:hover { color: #fff; transform: translateY(-1px); }

/* ---------- Buttons ---------- */
.mm-btn {
    display: inline-block;
    background: var(--mm-accent-gradient);
    color: #fff;
    font-weight: 900;
    font-size: 1.1rem;
    padding: 18px 38px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    box-shadow: 0 10px 40px rgba(255,45,45,0.35);
    transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.mm-btn:hover {
    color: #fff;
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 14px 50px rgba(255,45,45,0.5);
}
.mm-btn-block { display: block; width: 100%; text-align: center; }

/* ---------- Sections ---------- */
.mm-section { padding: 96px 0; }
.mm-section--tight { padding: 64px 0; }
.mm-section-head { text-align: center; max-width: 760px; margin: 0 auto 56px; }
.mm-section-head p { color: var(--mm-muted); font-size: 1.15rem; }

/* ---------- Hero ---------- */
.mm-hero {
    position: relative;
    overflow: hidden;
    padding: 120px 0 110px;
    text-align: center;
    background:
        radial-gradient(60% 80% at 50% -10%, rgba(255,45,45,0.22), transparent 60%),
        radial-gradient(50% 60% at 80% 10%, rgba(255,122,24,0.18), transparent 60%),
        var(--mm-bg);
}
.mm-hero h1 { max-width: 14ch; margin-left: auto; margin-right: auto; }
.mm-hero-sub {
    font-size: 1.3rem;
    color: var(--mm-muted);
    max-width: 38ch;
    margin: 1.2rem auto 2.4rem;
}
.mm-price-line {
    margin-top: 18px;
    color: var(--mm-muted);
    font-weight: 700;
    letter-spacing: 0.02em;
}
.mm-price-line strong { color: var(--mm-text); }

/* ---------- Interactive hero face demo ---------- */
.mm-demo {
    max-width: 420px;
    margin: 8px auto 36px;
    user-select: none;
}
.mm-demo-face-wrap {
    position: relative;
    width: 230px;
    height: 230px;
    margin: 0 auto 22px;
}
.mm-face {
    width: 100%;
    height: 100%;
    cursor: pointer;
    filter: drop-shadow(0 18px 50px rgba(255,45,45,0.35));
    transition: transform 0.12s ease;
}
.mm-face:active { transform: scale(0.97); }
/* Smooth morphing of colour, brows and steam. */
#mmFaceBg { transition: fill 0.35s ease; }
.mm-brow  { transition: transform 0.25s ease; transform-box: view-box; }
.mm-steam { transition: opacity 0.35s ease; }
.mm-steam circle { fill: #c9c9d4; }

/* Recoil when slapped. */
@keyframes mm-recoil {
    0%   { transform: scale(1) rotate(0); }
    30%  { transform: scale(0.94) rotate(-3deg); }
    60%  { transform: scale(1.03) rotate(2deg); }
    100% { transform: scale(1) rotate(0); }
}
.mm-hit .mm-face { animation: mm-recoil 0.28s ease; }

/* Meltdown: violent shake + red flash. */
@keyframes mm-shake {
    0%,100% { transform: translate(0,0) rotate(0); }
    20% { transform: translate(-6px,3px) rotate(-4deg); }
    40% { transform: translate(6px,-3px) rotate(4deg); }
    60% { transform: translate(-5px,-2px) rotate(-3deg); }
    80% { transform: translate(5px,2px) rotate(3deg); }
}
.mm-meltdown .mm-face { animation: mm-shake 0.18s linear infinite; }
.mm-meltdown-flash {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    font-weight: 900;
    font-size: 1.3rem;
    color: #fff;
    background: radial-gradient(circle, rgba(255,45,45,0.92), rgba(255,45,45,0));
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease;
}
.mm-meltdown-flash.show { opacity: 1; animation: mm-flash 0.16s steps(2) infinite; }
@keyframes mm-flash { 0% { opacity: 1; } 50% { opacity: 0.3; } 100% { opacity: 1; } }

/* Demo meter + slap button. */
.mm-demo-meter { margin-bottom: 16px; }
.mm-demo-meter-head {
    display: flex;
    justify-content: space-between;
    font-weight: 800;
    font-size: 0.92rem;
    margin-bottom: 8px;
}
.mm-demo-meter-head .mono { font-variant-numeric: tabular-nums; color: var(--mm-muted); }
.mm-demo-bar {
    height: 14px;
    border-radius: 999px;
    background: rgba(255,255,255,0.1);
    overflow: hidden;
}
.mm-demo-bar span {
    display: block;
    height: 100%;
    width: 0;
    border-radius: 999px;
    background: var(--mm-green);
    transition: width 0.25s ease, background 0.35s ease;
}
.mm-slap-btn {
    background: var(--mm-card);
    color: var(--mm-text);
    border: 1px solid var(--mm-border);
    border-radius: 12px;
    padding: 12px 22px;
    font-weight: 800;
    font-size: 1rem;
    cursor: pointer;
    transition: transform 0.1s ease, border-color 0.15s ease;
}
.mm-slap-btn:hover { border-color: var(--mm-orange); transform: translateY(-1px); }
.mm-slap-btn:active { transform: scale(0.96); }
.mm-demo-hint { color: var(--mm-muted); font-size: 0.9rem; margin: 12px 0 0; }

/* ---------- How it works ---------- */
.mm-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
}
.mm-step {
    background: var(--mm-card);
    border: 1px solid var(--mm-border);
    border-radius: 18px;
    padding: 34px 28px;
    text-align: center;
}
.mm-step-num {
    display: inline-flex;
    width: 46px; height: 46px;
    align-items: center; justify-content: center;
    border-radius: 50%;
    background: var(--mm-accent-gradient);
    font-weight: 900;
    margin-bottom: 16px;
    font-size: 1.2rem;
}
.mm-step-icon { font-size: 2.4rem; margin-bottom: 10px; }

/* ---------- Anger meter ---------- */
.mm-meter { display: flex; flex-direction: column; gap: 14px; max-width: 760px; margin: 0 auto; }
.mm-meter-row {
    display: grid;
    grid-template-columns: 76px 1fr;
    align-items: center;
    gap: 22px;
    background: var(--mm-card);
    border: 1px solid var(--mm-border);
    border-left-width: 6px;
    border-radius: 14px;
    padding: 20px 24px;
}
.mm-meter-emoji { font-size: 2.8rem; text-align: center; }
.mm-meter-row h3 { margin: 0 0 2px; }
.mm-meter-row p { margin: 0; color: var(--mm-muted); }
.mm-meter-row[data-level="0"] { border-left-color: var(--mm-green); }
.mm-meter-row[data-level="1"] { border-left-color: var(--mm-yellow); }
.mm-meter-row[data-level="2"] { border-left-color: var(--mm-orange); }
.mm-meter-row[data-level="3"] { border-left-color: var(--mm-red); }
.mm-meter-row[data-level="4"] {
    border-left-color: var(--mm-red);
    background: linear-gradient(100deg, rgba(255,45,45,0.16), var(--mm-card));
}

/* ---------- Features grid ---------- */
.mm-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}
.mm-feature {
    background: var(--mm-card);
    border: 1px solid var(--mm-border);
    border-radius: 16px;
    padding: 26px 22px;
    transition: transform 0.15s ease, border-color 0.15s ease;
}
.mm-feature:hover { transform: translateY(-4px); border-color: var(--mm-orange); }
.mm-feature-icon { font-size: 1.9rem; margin-bottom: 10px; }
.mm-feature h3 { font-size: 1.1rem; }
.mm-feature p { color: var(--mm-muted); font-size: 0.98rem; margin: 0; }

/* ---------- Social proof ---------- */
.mm-social { background: var(--mm-bg-2); }
.mm-social-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}
.mm-quote {
    background: var(--mm-card);
    border: 1px solid var(--mm-border);
    border-radius: 16px;
    padding: 26px;
}
.mm-quote p { margin: 0 0 14px; font-size: 1.05rem; }
.mm-quote .mm-quote-who { color: var(--mm-muted); font-weight: 700; font-size: 0.9rem; }
.mm-social-placeholder {
    text-align: center;
    color: var(--mm-muted);
    border: 1px dashed var(--mm-border);
    border-radius: 16px;
    padding: 26px;
    margin-top: 26px;
}

/* ---------- Buy CTA ---------- */
.mm-buy {
    text-align: center;
    background:
        radial-gradient(60% 100% at 50% 0%, rgba(255,45,45,0.28), transparent 60%),
        var(--mm-bg-2);
    border-top: 1px solid var(--mm-border);
    border-bottom: 1px solid var(--mm-border);
}
.mm-buy h2 { max-width: 16ch; margin: 0 auto 0.5em; }
.mm-buy .mm-price-line { margin-bottom: 28px; }

/* ---------- Email capture ---------- */
.mm-capture {
    max-width: 460px;
    margin: 0 auto 26px;
    text-align: left;
}
.mm-capture label {
    display: block;
    font-weight: 800;
    margin-bottom: 10px;
    color: var(--mm-text);
}
.mm-capture-row { display: flex; gap: 10px; }
.mm-capture input[type="email"] {
    flex: 1;
    background: var(--mm-bg);
    border: 1px solid var(--mm-border);
    border-radius: 12px;
    color: var(--mm-text);
    padding: 14px 16px;
    font-size: 1rem;
}
.mm-capture input[type="email"]:focus {
    outline: none;
    border-color: var(--mm-orange);
}
.mm-capture button {
    background: #fff;
    color: #111;
    border: none;
    border-radius: 12px;
    font-weight: 800;
    padding: 0 20px;
    cursor: pointer;
}
.mm-capture button:hover { background: var(--mm-yellow); }
.mm-notice {
    max-width: 460px;
    margin: 0 auto 20px;
    padding: 12px 16px;
    border-radius: 12px;
    font-weight: 700;
    text-align: center;
}
.mm-notice--ok  { background: rgba(46,204,113,0.16); color: #7ef0aa; border: 1px solid rgba(46,204,113,0.4); }
.mm-notice--err { background: rgba(255,45,45,0.16); color: #ff9a9a; border: 1px solid rgba(255,45,45,0.4); }

/* ---------- Footer ---------- */
.mm-site-footer {
    background: var(--mm-bg);
    border-top: 1px solid var(--mm-border);
    padding: 48px 0;
    color: var(--mm-muted);
    font-size: 0.95rem;
}
.mm-footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}
.mm-footer-links a { color: var(--mm-muted); margin-left: 18px; }
.mm-footer-links a:hover { color: var(--mm-orange); }
.mm-beappi { color: var(--mm-text); font-weight: 800; }

/* ---------- Generic page content (privacy etc.) ---------- */
.mm-page { padding: 80px 0; }
.mm-page .mm-container { max-width: 800px; }
.mm-page h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); margin-bottom: 0.6em; }
.mm-page h2 { font-size: 1.6rem; margin-top: 1.6em; }
.mm-page p, .mm-page li { color: #d9d9de; }
.mm-page a { text-decoration: underline; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
    .mm-features { grid-template-columns: repeat(2, 1fr); }
    .mm-steps, .mm-social-grid { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
    body { font-size: 17px; }
    .mm-features { grid-template-columns: 1fr; }
    .mm-capture-row { flex-direction: column; }
    .mm-meter-row { grid-template-columns: 56px 1fr; gap: 14px; }
    .mm-nav-cta { display: none; }
}
