/* =====================================================
   Appthropy — style.css
   ===================================================== */

/* ---- Custom Properties ---- */
:root {
    --primary:       #e8533a;
    --primary-dark:  #c94428;
    --primary-light: #ff7a5e;
    --dark:          #111827;
    --bg:            #f9f8f5;
    --white:         #ffffff;
    --gray-100:      #f3f4f6;
    --gray-200:      #e5e7eb;
    --gray-400:      #9ca3af;
    --gray-600:      #6b7280;
    --gray-800:      #1f2937;
    --blue:          #3b82f6;
    --green:         #10b981;
    --red:           #ef4444;

    --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.08);
    --shadow-md:  0 4px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg:  0 8px 32px rgba(0, 0, 0, 0.14);

    --radius:    12px;
    --radius-sm:  8px;
    --radius-lg: 20px;
    --transition: 0.2s ease;

    --nav-height: 64px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ---- Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--dark);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input { font: inherit; }

/* ---- Utilities ---- */
.container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
}

.sr-only {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    line-height: 1;
    transition: all var(--transition);
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}
.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(232, 83, 58, 0.35);
}

.btn-secondary {
    background: var(--dark);
    color: var(--white);
}
.btn-secondary:hover { opacity: 0.85; }

.btn-outline {
    background: transparent;
    border: 2px solid currentColor;
}
.btn-outline:hover {
    background: currentColor;
}
/* make text readable on hover for dark btn-outline */
.btn-outline:hover span,
.btn-outline:hover svg { color: var(--white); }
.rate-section .btn-outline:hover { color: var(--white); }

.btn-ghost {
    background: transparent;
    color: var(--primary);
    padding: 10px 20px;
}
.btn-ghost:hover { background: rgba(232, 83, 58, 0.06); }

.btn-sm { padding: 8px 16px; font-size: 0.875rem; }

.btn-store { gap: 8px; }
.btn-store svg { flex-shrink: 0; }

.btn:disabled { opacity: 0.6; cursor: not-allowed; pointer-events: none; }

/* ---- Navigation ---- */
.nav {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 100;
    height: var(--nav-height);
    background: rgba(249, 248, 245, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border-bottom: 1px solid transparent;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.nav.scrolled {
    border-color: var(--gray-200);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-mark {
    width: 36px; height: 36px;
    background: var(--primary);
    color: var(--white);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.logo-text {
    font-weight: 700;
    font-size: 1.0625rem;
    color: var(--dark);
    letter-spacing: -0.3px;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 32px;
}
.nav-links a {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--gray-600);
    transition: color var(--transition);
}
.nav-links a:hover { color: var(--dark); }
.nav-links .btn { color: var(--white); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    width: 28px;
    padding: 4px;
}
.nav-toggle span {
    display: block;
    height: 2px;
    background: var(--dark);
    border-radius: 2px;
    transition: all 0.3s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---- Hero ---- */
.hero {
    padding: calc(var(--nav-height) + 80px) 0 80px;
    overflow: hidden;
}
.hero .container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 64px;
    align-items: center;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: rgba(232, 83, 58, 0.08);
    color: var(--primary);
    border-radius: 100px;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    margin-bottom: 20px;
}

.hero-content h1 {
    font-size: clamp(2.1rem, 4vw, 3.4rem);
    font-weight: 800;
    line-height: 1.14;
    letter-spacing: -0.04em;
    color: var(--dark);
    margin-bottom: 24px;
}
.hero-content h1 em {
    font-style: normal;
    color: var(--primary);
}

.hero-sub {
    font-size: 1.125rem;
    color: var(--gray-600);
    max-width: 480px;
    margin-bottom: 36px;
    line-height: 1.7;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.hero-actions .btn-store {
    background: var(--dark);
    color: var(--white);
}
.hero-actions .btn-store:hover {
    background: var(--gray-800);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Phone Mockup */
.hero-visual {
    display: flex;
    justify-content: center;
    align-items: center;
}

.phone-frame {
    width: 220px;
    height: 440px;
    background: var(--dark);
    border-radius: 34px;
    padding: 10px;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.06);
    transform: rotateY(-8deg) rotateX(3deg);
    position: relative;
}

.phone-notch {
    width: 72px;
    height: 18px;
    background: var(--dark);
    border-radius: 0 0 12px 12px;
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 2;
}

.phone-screen {
    width: 100%;
    height: 100%;
    background: var(--bg);
    border-radius: 26px;
    overflow: hidden;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 32px;
}

.screen-placeholder { padding: 16px; width: 100%; }

.screen-ui { display: flex; flex-direction: column; gap: 10px; }

.screen-header {
    height: 14px;
    background: var(--gray-200);
    border-radius: 100px;
    width: 50%;
    margin-bottom: 4px;
}

.screen-bar {
    height: 8px;
    background: var(--gray-200);
    border-radius: 100px;
    width: 100%;
}
.screen-bar.short { width: 55%; }

.screen-card {
    margin-top: 4px;
    background: var(--white);
    border-radius: 10px;
    padding: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    align-items: center;
    gap: 10px;
}
.screen-card-dot {
    width: 20px; height: 20px;
    background: var(--gray-200);
    border-radius: 50%;
    flex-shrink: 0;
}
.screen-card-dot.accent { background: rgba(232, 83, 58, 0.3); }
.screen-card-dot.green  { background: rgba(16, 185, 129, 0.3); }

.screen-card-lines { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.screen-card-lines div {
    height: 7px;
    background: var(--gray-200);
    border-radius: 100px;
}
.screen-card-lines div:last-child { width: 70%; }

/* ---- Section Base ---- */
.section { padding: 96px 0; }

.section-header {
    text-align: center;
    max-width: 580px;
    margin: 0 auto 56px;
}

.section-eyebrow {
    display: inline-flex;
    padding: 5px 12px;
    background: rgba(232, 83, 58, 0.08);
    color: var(--primary);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    margin-bottom: 16px;
}

.section-header h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--dark);
    margin-bottom: 14px;
    line-height: 1.2;
}

.section-header p {
    font-size: 1.0625rem;
    color: var(--gray-600);
    line-height: 1.7;
}

.section-footer {
    text-align: center;
    margin-top: 48px;
}

/* ---- Apps Section ---- */
.apps-section { background: var(--white); }

.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
}

.app-card {
    display: flex;
    gap: 20px;
    padding: 28px;
    background: var(--bg);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.app-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.app-icon {
    width: 60px; height: 60px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.app-icon--1 { background: rgba(232, 83, 58, 0.1); color: var(--primary); }
.app-icon--2 { background: rgba(59, 130, 246, 0.1); color: var(--blue); }
.app-icon--3 { background: rgba(16, 185, 129, 0.1); color: var(--green); }

.app-info h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: var(--dark);
}
.app-info p {
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.65;
    margin-bottom: 16px;
}

.app-store-links { display: flex; gap: 10px; flex-wrap: wrap; }

.store-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--primary);
    padding: 5px 12px;
    border: 1.5px solid rgba(232, 83, 58, 0.3);
    border-radius: 100px;
    transition: all var(--transition);
}
.store-link:hover {
    background: var(--primary);
    color: var(--white);
    border-color: var(--primary);
}

/* Ad placeholder */
.ad-placeholder {
    margin-top: 48px;
    padding: 24px;
    border: 2px dashed var(--gray-200);
    border-radius: var(--radius);
    text-align: center;
    color: var(--gray-400);
    font-size: 0.875rem;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ---- Rate Us ---- */
.rate-section {
    background: var(--dark);
    color: var(--white);
    padding: 80px 0;
}
.rate-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
    flex-wrap: wrap;
}
.rate-text h2 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 10px;
}
.rate-text p {
    font-size: 1.0625rem;
    color: rgba(255, 255, 255, 0.65);
}
.rate-actions { display: flex; gap: 12px; flex-wrap: wrap; flex-shrink: 0; }

.rate-section .btn-outline {
    border-color: rgba(255, 255, 255, 0.4);
    color: var(--white);
}
.rate-section .btn-outline:hover {
    background: var(--white);
    color: var(--dark);
    border-color: var(--white);
}
.rate-section .btn-outline:hover span,
.rate-section .btn-outline:hover svg { color: var(--dark); }

/* ---- Social ---- */
.social-section { background: var(--bg); }

.social-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    max-width: 700px;
    margin: 0 auto;
}

.social-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 28px 16px;
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    color: var(--dark);
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition), color var(--transition);
    text-align: center;
}
.social-card span {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-600);
    transition: color var(--transition);
}
.social-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
    color: var(--primary);
}
.social-card:hover span { color: var(--primary); }

/* ---- Blog ---- */
.blog-section { background: var(--white); }

.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

.blog-card {
    background: var(--bg);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
}
.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
    border-color: transparent;
}

.blog-img-placeholder {
    height: 180px;
    background: var(--gray-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gray-400);
    overflow: hidden;
}
/* When replacing with a real <img>: */
.blog-img-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.blog-content { padding: 24px; }

.blog-tag {
    display: inline-block;
    padding: 3px 10px;
    background: rgba(232, 83, 58, 0.08);
    color: var(--primary);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    margin-bottom: 12px;
}

.blog-content h3 {
    font-size: 1.0625rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--dark);
}
.blog-content h3 a { transition: color var(--transition); }
.blog-content h3 a:hover { color: var(--primary); }

.blog-content p {
    font-size: 0.9rem;
    color: var(--gray-600);
    line-height: 1.65;
    margin-bottom: 16px;
}

.blog-meta {
    display: flex;
    gap: 8px;
    font-size: 0.8125rem;
    color: var(--gray-400);
}

/* ---- Newsletter ---- */
.newsletter-section { background: var(--bg); }

.newsletter-content {
    max-width: 640px;
    margin: 0 auto;
    text-align: center;
}

.newsletter-text h2 {
    font-size: clamp(1.75rem, 3vw, 2.5rem);
    font-weight: 800;
    letter-spacing: -0.03em;
    color: var(--dark);
    margin-bottom: 12px;
}
.newsletter-text p {
    font-size: 1.0625rem;
    color: var(--gray-600);
    margin-bottom: 36px;
    line-height: 1.7;
}

.newsletter-form .input-group {
    display: flex;
    max-width: 460px;
    margin: 0 auto;
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 4px;
    transition: border-color var(--transition);
}
.newsletter-form .input-group:focus-within { border-color: var(--primary); }

.newsletter-form input[type="email"] {
    flex: 1;
    padding: 10px 14px;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.9375rem;
    color: var(--dark);
    min-width: 0;
}
.newsletter-form input[type="email"]::placeholder { color: var(--gray-400); }

.newsletter-form .btn { border-radius: 6px; padding: 10px 18px; flex-shrink: 0; }

.form-message {
    margin-top: 14px;
    font-size: 0.9rem;
    font-weight: 500;
    min-height: 22px;
}
.form-message.success { color: var(--green); }
.form-message.error   { color: var(--red); }
.form-message.info    { color: var(--blue); }

/* ---- Modal ---- */
.modal {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}
.modal[hidden] { display: none; }

.modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    position: relative;
    background: var(--white);
    border-radius: var(--radius);
    padding: 40px;
    max-width: 420px;
    width: 100%;
    box-shadow: var(--shadow-lg);
}

.modal-close {
    position: absolute;
    top: 14px; right: 14px;
    width: 32px; height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    font-size: 1.3rem;
    color: var(--gray-400);
    transition: all var(--transition);
}
.modal-close:hover { background: var(--gray-100); color: var(--dark); }

.modal-content h3 {
    font-size: 1.375rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.modal-content > p {
    color: var(--gray-600);
    margin-bottom: 24px;
    font-size: 0.9375rem;
}

.modal-content .input-group {
    display: flex;
    background: var(--bg);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 4px;
    transition: border-color var(--transition);
}
.modal-content .input-group:focus-within { border-color: var(--primary); }

.modal-content input[type="email"] {
    flex: 1;
    padding: 10px 14px;
    background: transparent;
    border: none;
    outline: none;
    font-size: 0.9375rem;
    color: var(--dark);
    min-width: 0;
}
.modal-content .btn { border-radius: 6px; flex-shrink: 0; }

/* ---- Toast ---- */
.toast {
    position: fixed;
    top: calc(var(--nav-height) + 16px);
    right: 24px;
    z-index: 300;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
    border-left: 4px solid var(--gray-400);
    font-size: 0.9375rem;
    font-weight: 500;
    max-width: 360px;
    animation: slideIn 0.3s ease;
}
.toast-success { border-color: var(--green); }
.toast-info    { border-color: var(--blue); }
.toast-error   { border-color: var(--red); }

.toast-close {
    font-size: 1.25rem;
    color: var(--gray-400);
    margin-left: auto;
    padding: 0 2px;
    flex-shrink: 0;
    line-height: 1;
}
.toast-close:hover { color: var(--dark); }

@keyframes slideIn {
    from { transform: translateX(110%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

/* ---- Footer ---- */
.footer {
    background: var(--dark);
    color: var(--white);
    padding-top: 64px;
}

.footer-top {
    display: flex;
    gap: 48px;
    justify-content: space-between;
    flex-wrap: wrap;
    padding-bottom: 48px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-brand .nav-logo { margin-bottom: 12px; }
.footer-brand .logo-text { color: var(--white); }
.footer-brand p { color: rgba(255, 255, 255, 0.5); font-size: 0.9rem; }

.footer-links { display: flex; gap: 48px; flex-wrap: wrap; }

.footer-col h4 {
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.45);
    margin-bottom: 16px;
}

.footer-col ul { display: flex; flex-direction: column; gap: 10px; }

.footer-col a {
    color: rgba(255, 255, 255, 0.65);
    font-size: 0.9rem;
    transition: color var(--transition);
}
.footer-col a:hover { color: var(--white); }

.footer-bottom {
    padding: 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
}
.footer-bottom p { color: rgba(255, 255, 255, 0.35); font-size: 0.875rem; }

/* ---- Scroll animations ---- */
.fade-in {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity 0.5s ease, transform 0.5s ease;
}
.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger children in grids */
.apps-grid   .fade-in:nth-child(2) { transition-delay: 0.1s; }
.apps-grid   .fade-in:nth-child(3) { transition-delay: 0.2s; }
.blog-grid   .fade-in:nth-child(2) { transition-delay: 0.1s; }
.blog-grid   .fade-in:nth-child(3) { transition-delay: 0.2s; }
.social-grid .fade-in:nth-child(2) { transition-delay: 0.07s; }
.social-grid .fade-in:nth-child(3) { transition-delay: 0.14s; }
.social-grid .fade-in:nth-child(4) { transition-delay: 0.21s; }

@media (prefers-reduced-motion: reduce) {
    .fade-in { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
    .phone-frame { transform: none; }
}

/* ---- Responsive: Tablet ---- */
@media (max-width: 900px) {
    .hero .container {
        grid-template-columns: 1fr;
        text-align: center;
    }
    .hero-sub { margin-left: auto; margin-right: auto; }
    .hero-actions { justify-content: center; }
    .hero-visual { order: -1; }
    .phone-frame { transform: none; }

    .social-grid { grid-template-columns: repeat(2, 1fr); max-width: 400px; }

    .rate-content { flex-direction: column; text-align: center; }
    .rate-actions { justify-content: center; }
}

/* ---- Responsive: Mobile ---- */
@media (max-width: 768px) {
    .nav-links {
        display: none;
        position: absolute;
        top: var(--nav-height);
        left: 0; right: 0;
        background: rgba(249, 248, 245, 0.98);
        backdrop-filter: blur(12px);
        border-bottom: 1px solid var(--gray-200);
        flex-direction: column;
        align-items: flex-start;
        padding: 16px 24px 24px;
        gap: 18px;
    }
    .nav-links.open { display: flex; }
    .nav-toggle { display: flex; }

    .section { padding: 72px 0; }

    .footer-top { flex-direction: column; }
    .footer-bottom { flex-direction: column; text-align: center; }

    .newsletter-form .input-group {
        flex-direction: column;
        background: transparent;
        border: none;
        padding: 0;
        gap: 12px;
    }
    .newsletter-form input[type="email"] {
        background: var(--white);
        border: 2px solid var(--gray-200);
        border-radius: var(--radius-sm);
        padding: 13px 16px;
        width: 100%;
    }
    .newsletter-form .btn {
        border-radius: var(--radius-sm);
        justify-content: center;
        padding: 13px 20px;
        width: 100%;
    }

    .modal-content { padding: 28px 20px; }

    .toast { right: 16px; left: 16px; max-width: none; }
}

@media (max-width: 480px) {
    .apps-grid  { grid-template-columns: 1fr; }
    .blog-grid  { grid-template-columns: 1fr; }
    .footer-links { gap: 32px; }
}
