/* ============================================
   Caliq - Smart Calendar for Apple
   Apple-inspired minimal website stylesheet
   ============================================ */

/* --- Custom Properties --- */
:root {
    --bg: #fbfbfd;
    --bg-alt: #f5f5f7;
    --surface: #ffffff;
    --text: #1d1d1f;
    --text-secondary: #86868b;
    --accent: #0071e3;
    --accent-hover: #0077ed;
    --border: #d2d2d7;
    --nav-bg: rgba(251, 251, 253, 0.72);
    --shadow: 0 2px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 8px 40px rgba(0, 0, 0, 0.12);
    --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Helvetica Neue', Helvetica, Arial, sans-serif;
    --nav-height: 48px;
    --max-w: 980px;
    --radius: 18px;
    --radius-sm: 12px;
    color-scheme: light;
}

/* --- Reset --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

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

body {
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.47;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--accent-hover);
}

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

ul, ol {
    list-style: none;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    background: none;
}

/* --- Utility --- */
.container {
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 22px;
}

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

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

/* --- Typography --- */
.hero-title {
    font-size: clamp(40px, 8vw, 80px);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1.05;
    color: var(--text);
}

.section-title {
    font-size: clamp(32px, 5.5vw, 56px);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.07;
    color: var(--text);
}

.section-subtitle {
    font-size: clamp(24px, 3.5vw, 40px);
    font-weight: 600;
    letter-spacing: -0.02em;
    line-height: 1.1;
    color: var(--text);
}

.subhead {
    font-size: clamp(17px, 2.2vw, 21px);
    font-weight: 400;
    line-height: 1.5;
    color: var(--text-secondary);
}

.label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--accent);
}

/* --- Navigation --- */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--nav-height);
    background: var(--nav-bg);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
    transition: background 0.3s;
}

.nav-inner {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 22px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    line-height: 0;
    text-decoration: none;
}

.nav-logo:hover {
    color: var(--text);
}

.nav-logo img {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    object-fit: cover;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 28px;
}

.nav-links a {
    font-size: 14px;
    color: var(--text-secondary);
    transition: color 0.2s;
    text-decoration: none;
}

.nav-links a:hover {
    color: var(--text);
}

.nav-cta {
    font-size: 14px !important;
    color: var(--surface) !important;
    background: var(--accent);
    padding: 6px 16px;
    border-radius: 100px;
    transition: background 0.2s, color 0.2s !important;
}

.nav-cta:hover {
    background: var(--accent-hover);
    color: var(--surface) !important;
}

/* Mobile nav toggle */
.nav-toggle {
    display: none;
    position: relative;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    z-index: 1001;
    -webkit-tap-highlight-color: transparent;
}

.nav-toggle span {
    position: absolute;
    left: 10px;
    width: 20px;
    height: 1.5px;
    background: var(--text);
    transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.18s ease;
    border-radius: 1px;
    transform-origin: center;
}

.nav-toggle span:nth-child(1) {
    transform: translateY(-4px);
}

.nav-toggle span:nth-child(2) {
    transform: translateY(4px);
}

.nav-toggle span:nth-child(3) {
    opacity: 0;
    transform: scaleX(0);
}

.nav-toggle.active span:nth-child(1) {
    transform: rotate(45deg);
}

.nav-toggle.active span:nth-child(2) {
    transform: rotate(-45deg);
}

.nav-toggle.active span:nth-child(3) {
    opacity: 0;
    transform: scaleX(0);
}

@media (max-width: 734px) {
    .nav {
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        background: var(--bg);
    }

    .nav-toggle {
        display: flex;
    }

    .nav-links {
        position: fixed;
        inset: 0;
        top: calc(var(--nav-height) + 1px);
        background-color: rgba(251, 251, 253, 0.98);
        flex-direction: column;
        justify-content: flex-start;
        align-items: stretch;
        overflow-y: auto;
        padding: 24px 22px 32px;
        gap: 0;
        visibility: hidden;
        transform: translateY(-10px);
        opacity: 0;
        pointer-events: none;
        transition:
            opacity 0.24s ease,
            transform 0.32s cubic-bezier(0.4, 0, 0.2, 1),
            visibility 0s linear 0.32s;
        z-index: 9999;
        -webkit-backdrop-filter: none;
        backdrop-filter: none;
    }

    .nav-links.open {
        visibility: visible;
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
        transition-delay: 0s;
    }

    .nav-links a {
        font-size: 22px;
        font-weight: 600;
        color: var(--text);
        display: block;
        padding: 14px 0;
        width: 100%;
        background: transparent;
        opacity: 0;
        transform: translateY(-6px);
        transition:
            opacity 0.24s ease,
            transform 0.36s cubic-bezier(0.4, 0, 0.2, 1),
            color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .nav-links.open a {
        opacity: 1;
        transform: translateY(0);
    }

    .nav-links.open a:nth-child(1) {
        transition-delay: 0.03s;
    }

    .nav-links.open a:nth-child(2) {
        transition-delay: 0.06s;
    }

    .nav-links.open a:nth-child(3) {
        transition-delay: 0.09s;
    }

    .nav-links.open a:nth-child(4) {
        transition-delay: 0.12s;
    }

    .nav-links a:active {
        color: var(--text-secondary);
    }

    .nav-cta {
        margin-top: 0;
        font-size: 22px !important;
        font-weight: 600;
        color: var(--text) !important;
        background: transparent;
        padding: 14px 0;
        display: block;
        text-align: left;
        border-bottom: none;
        border-radius: 0;
        box-shadow: none;
        opacity: 0;
        transform: translateY(-6px);
    }

    .nav-cta:hover,
    .nav-cta:active {
        background: transparent;
        color: var(--text-secondary) !important;
    }

    .nav-links.open .nav-cta {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Hero Section --- */
.hero {
    padding-top: calc(var(--nav-height) + 60px);
    padding-bottom: 40px;
    text-align: center;
}

@keyframes subpage-enter {
    from {
        opacity: 0;
        transform: translateY(18px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.support,
.contact,
.legal {
    animation: subpage-enter 0.48s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-title {
    margin-bottom: 16px;
}

.hero .subhead {
    max-width: 600px;
    margin: 0 auto 32px;
}

.hero-badges {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 60px;
}

.app-store-badge {
    height: 44px;
    transition: opacity 0.2s;
}

.app-store-badge:hover {
    opacity: 0.8;
}

/* Theme-aware badge */
.badge-light {
    display: inline-block;
}

.badge-dark {
    display: none;
}

.hero-image {
    max-width: 900px;
    margin: 0 auto;
    border-radius: var(--radius);
    overflow: hidden;
}

.hero-image img {
    width: 100%;
    border-radius: var(--radius);
}

/* --- Feature Sections --- */
.feature {
    padding: 84px 0;
    text-align: center;
    overflow: hidden;
}

.feature .label {
    margin-bottom: 12px;
}

.feature .section-title {
    margin-bottom: 16px;
}

.feature .subhead {
    max-width: 600px;
    margin: 0 auto 36px;
}

.feature-image {
    max-width: 800px;
    margin: 0 auto;
    border-radius: var(--radius);
    overflow: hidden;
}

.feature-image img {
    width: 100%;
    border-radius: var(--radius);
    -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 82%, transparent 100%);
    mask-image: linear-gradient(to bottom, #000 0%, #000 82%, transparent 100%);
    -webkit-mask-size: 100% 100%;
    mask-size: 100% 100%;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
}

.feature-image-wide {
    max-width: 1000px;
}

/* Dark showcase feature */
.feature-dark {
    background: #000;
    color: #f5f5f7;
}

.feature-dark .section-title,
.feature-dark .section-subtitle {
    color: #f5f5f7;
}

.feature-dark .subhead {
    color: #86868b;
}

.feature-dark .label {
    color: #2997ff;
}

/* Light showcase feature (for images with white bg) */
.feature-light {
    background: var(--bg-alt);
}

/* --- Pricing Section --- */
.pricing {
    padding: 100px 0;
    text-align: center;
}

.pricing .section-title {
    margin-bottom: 12px;
}

.pricing .subhead {
    max-width: 500px;
    margin: 0 auto 56px;
}

.pricing-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 720px;
    margin: 0 auto;
}

.pricing-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 32px;
    text-align: left;
    transition: transform 0.3s, box-shadow 0.3s;
}

.pricing-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.pricing-card.featured {
    border-color: var(--accent);
    position: relative;
}

.pricing-badge {
    position: absolute;
    top: -12px;
    left: 32px;
    background: var(--accent);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 14px;
    border-radius: 100px;
    letter-spacing: 0.02em;
}

.pricing-tier {
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.pricing-price {
    font-size: 40px;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
}

.pricing-price span {
    font-size: 17px;
    font-weight: 400;
    color: var(--text-secondary);
}

.pricing-features {
    margin-top: 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.pricing-features li {
    font-size: 14px;
    color: var(--text-secondary);
    padding-left: 20px;
    position: relative;
    line-height: 1.4;
}

.pricing-features li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 6px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
}

@media (max-width: 600px) {
    .pricing-grid {
        grid-template-columns: 1fr;
    }
}

/* --- Privacy Callout --- */
.privacy-callout {
    padding: 80px 0;
    text-align: center;
    background: var(--bg-alt);
}

.privacy-callout .section-subtitle {
    margin-bottom: 12px;
}

.privacy-callout .subhead {
    max-width: 520px;
    margin: 0 auto;
}

/* --- CTA Section --- */
.cta {
    padding: 100px 0;
    text-align: center;
}

.cta .section-title {
    margin-bottom: 16px;
}

.cta .subhead {
    margin-bottom: 32px;
}

/* --- Footer --- */
.footer {
    border-top: 1px solid var(--border);
    padding: 20px 0;
    color: var(--text-secondary);
    font-size: 12px;
}

.footer-inner {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 22px;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 20px;
    margin-bottom: 12px;
}

.footer-links a {
    color: var(--text-secondary);
    font-size: 12px;
}

.footer-links a:hover {
    color: var(--text);
}

.footer-copy {
    color: var(--text-secondary);
    line-height: 1.5;
    text-align: center;
}

@media (min-width: 735px) {
    .footer-inner {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    .footer-links {
        width: 100%;
        justify-content: center;
    }

    .footer-copy {
        text-align: center;
    }
}

/* --- Legal Pages (Terms, Privacy) --- */
.legal {
    padding-top: calc(var(--nav-height) + 60px);
    padding-bottom: 80px;
}

.legal h1 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 8px;
}

.legal .legal-date {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 48px;
}

.legal h2 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-top: 48px;
    margin-bottom: 12px;
}

.legal h3 {
    font-size: 19px;
    font-weight: 600;
    margin-top: 32px;
    margin-bottom: 8px;
}

.legal p {
    color: var(--text-secondary);
    margin-bottom: 16px;
    line-height: 1.6;
    max-width: 680px;
}

.legal ul, .legal ol {
    margin-bottom: 16px;
    padding-left: 24px;
    max-width: 680px;
}

.legal ul {
    list-style: disc;
}

.legal ol {
    list-style: decimal;
}

.legal li {
    color: var(--text-secondary);
    margin-bottom: 8px;
    line-height: 1.5;
}

.legal a {
    text-decoration: underline;
}

/* --- Support Page --- */
.support {
    padding-top: calc(var(--nav-height) + 60px);
    padding-bottom: 80px;
}

.support h1 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 28px;
}

.support > .subhead,
.contact-main > .subhead,
.contact-info-summary {
    font-size: 17px;
    font-weight: 400;
    line-height: 1.6;
    color: var(--text);
    opacity: 1;
}

.support > .subhead {
    max-width: none;
    margin-bottom: 48px;
}

.faq-group {
    margin-bottom: 48px;
}

.faq-group h2 {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
}

.faq-item {
    border-bottom: 1px solid var(--border);
}

.faq-item summary {
    padding: 16px 0;
    font-size: 17px;
    font-weight: 500;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    color: var(--text);
    transition: color 0.2s;
}

.faq-item summary:hover {
    color: var(--accent);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 22px;
    font-weight: 300;
    color: var(--text-secondary);
    flex-shrink: 0;
    transition: transform 0.3s;
}

.faq-item[open] summary::after {
    transform: rotate(45deg);
}

.faq-item .faq-answer {
    padding: 0 0 20px;
    color: var(--text-secondary);
    line-height: 1.6;
    max-width: 680px;
}

.faq-item .faq-answer p {
    margin-bottom: 8px;
}

.faq-item .faq-answer p:last-child {
    margin-bottom: 0;
}

.support-contact {
    margin-top: 56px;
    padding: 40px;
    background: var(--bg-alt);
    border-radius: var(--radius);
    text-align: center;
}

.support-contact h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
}

.support-contact p {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

/* --- Contact Page --- */
.contact {
    padding-top: calc(var(--nav-height) + 60px);
    padding-bottom: 80px;
}

.contact h1 {
    font-size: clamp(32px, 5vw, 48px);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 28px;
}

.contact-main {
    display: flex;
    flex-direction: column;
}

.contact-main > .subhead {
    max-width: 34ch;
    margin-bottom: 16px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    align-items: start;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 6px;
    color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    font-family: var(--font);
    font-size: 17px;
    color: var(--text);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--accent);
}

.form-group textarea {
    resize: vertical;
    min-height: 140px;
}

.form-group select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none'%3E%3Cpath d='M1 1.5l5 5 5-5' stroke='%2386868b' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    padding-right: 40px;
}

.contact-form-hidden {
    position: absolute;
    left: -9999px;
    opacity: 0;
    pointer-events: none;
}

.contact-turnstile-wrap {
    min-height: 66px;
    width: 100%;
    display: flex;
    justify-content: center;
}

.contact-turnstile {
    min-height: 65px;
    display: flex;
    justify-content: center;
}

.contact-form-note {
    margin-top: -8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.contact-form-status {
    min-height: 24px;
    margin-top: -4px;
    font-size: 15px;
    font-weight: 500;
}

.contact-form-status[data-state="success"] {
    color: #1f7a47;
}

.contact-form-status[data-state="error"] {
    color: #b42318;
}

.contact-form-status[data-state="loading"] {
    color: var(--text-secondary);
}

.contact-submit:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

.btn {
    display: inline-block;
    padding: 12px 28px;
    font-size: 17px;
    font-weight: 500;
    color: #fff;
    background: var(--accent);
    border: none;
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.2s;
    text-align: center;
}

.btn:hover {
    background: var(--accent-hover);
    color: #fff;
}

.contact-info {
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

@media (min-width: 735px) {
    .contact-info {
        width: min(100%, 34ch);
        justify-self: center;
    }

    .contact-info-summary {
        max-width: none;
    }
}

.contact-email-inline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: -0.18em;
    margin: 0 0.16em;
    color: var(--accent);
    text-decoration: none;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.contact-email-inline:visited {
    color: var(--accent);
}

.contact-email-inline:hover {
    color: var(--accent);
    opacity: 0.72;
    transform: translateY(-1px);
}

.contact-email-inline-icon {
    display: inline-block;
    width: 18px !important;
    height: 18px !important;
    min-width: 18px;
    max-width: none;
    flex: 0 0 18px;
    fill: currentColor;
}

.contact-info-summary {
    max-width: 34ch;
}

@media (prefers-reduced-motion: reduce) {
    .support,
    .contact,
    .legal {
        animation: none;
    }
}

@media (max-width: 734px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .support > .subhead {
        margin-bottom: 36px;
    }

    .contact-info {
        padding: 0;
        align-items: center;
    }

    .contact-main > .subhead {
        margin-bottom: 18px;
    }

    .contact-form-note,
    .contact-form-status {
        text-align: center;
    }

    .contact-info-summary {
        text-align: center;
        margin: 0 auto;
    }
}

/* --- Scroll Reveal Animations --- */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal.revealed {
    opacity: 1;
    transform: none;
}

.reveal-scale {
    opacity: 0;
    transform: scale(0.96) translateY(20px);
    transition: opacity 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.9s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-scale.revealed {
    opacity: 1;
    transform: none;
}

/* Staggered delays */
.reveal-d1 { transition-delay: 0.1s; }
.reveal-d2 { transition-delay: 0.2s; }
.reveal-d3 { transition-delay: 0.3s; }
.reveal-d4 { transition-delay: 0.4s; }

/* --- Responsive --- */
@media (max-width: 734px) {
    .hero {
        padding-top: calc(var(--nav-height) + 40px);
        padding-bottom: 20px;
    }

    .hero-title {
        margin-bottom: 12px;
    }

    .hero-badges {
        margin-bottom: 40px;
    }

    .feature {
        padding: 52px 0;
    }

    .feature .subhead {
        margin-bottom: 24px;
    }

    .pricing {
        padding: 60px 0;
    }

    .pricing-card {
        padding: 28px 24px;
    }

    .cta {
        padding: 60px 0;
    }

    .legal {
        padding-top: calc(var(--nav-height) + 40px);
    }

    .support {
        padding-top: calc(var(--nav-height) + 40px);
    }

    .contact {
        padding-top: calc(var(--nav-height) + 40px);
    }

    .support-contact {
        padding: 28px 22px;
    }
}

@media (max-width: 480px) {
    .pricing-price {
        font-size: 32px;
    }
}

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

    .reveal,
    .reveal-scale {
        opacity: 1;
        transform: none;
        transition: none;
    }
}
