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

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f5f5f7;
    --bg-card: #ffffff;
    --text-primary: #1d1d1f;
    --text-secondary: #6e6e73;
    --text-tertiary: #aeaeb2;
    --accent: #2d9d8f;
    --accent-light: rgba(45, 157, 143, 0.08);
    --accent-hover: #258a7e;
    --border: rgba(0, 0, 0, 0.06);
    --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.04);
    --shadow-hover: 0 4px 24px rgba(0, 0, 0, 0.08);
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --transition: 0.3s ease;
}

[data-theme="dark"] {
    --bg-primary: #000000;
    --bg-secondary: #1c1c1e;
    --bg-card: #1c1c1e;
    --text-primary: #f5f5f7;
    --text-secondary: #a1a1a6;
    --text-tertiary: #636366;
    --accent: #5ac8be;
    --accent-light: rgba(90, 200, 190, 0.12);
    --accent-hover: #4bb8ae;
    --border: rgba(255, 255, 255, 0.08);
    --shadow-card: 0 2px 16px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 4px 24px rgba(0, 0, 0, 0.4);
}

html {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text',
                 'Helvetica Neue', Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: background var(--transition), color var(--transition);
    line-height: 1.6;
}

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

/* Dark/light image switching */
[data-theme="dark"] .light-only { display: none !important; }
[data-theme="dark"] .dark-only  { display: block !important; }
.dark-only  { display: none !important; }
.light-only { display: block !important; }

/* ===== Header ===== */
.studio-header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: rgba(255, 255, 255, 0.72);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border-bottom: 1px solid var(--border);
    transition: background var(--transition);
}

[data-theme="dark"] .studio-header {
    background: rgba(0, 0, 0, 0.72);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 52px;
}

.studio-brand {
    display: flex;
    align-items: baseline;
    gap: 6px;
}

.studio-name {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.studio-label {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* ===== Language Picker ===== */
.lang-picker {
    position: relative;
}

.lang-current {
    display: flex;
    align-items: center;
    gap: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 500;
    transition: color 0.2s;
    letter-spacing: 0.01em;
}

.lang-current svg { display: none; }

.lang-current:hover { color: var(--text-primary); }

.lang-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: rgba(255, 255, 255, 0.82);
    backdrop-filter: saturate(180%) blur(20px);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    padding: 4px;
    min-width: 140px;
    z-index: 200;
    opacity: 0;
    transform: translateY(-4px) scale(0.98);
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

[data-theme="dark"] .lang-dropdown {
    background: rgba(44, 44, 46, 0.82);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.32);
}

.lang-dropdown.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

.lang-dropdown button {
    display: block;
    width: 100%;
    text-align: left;
    padding: 7px 12px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-primary);
    border-radius: 6px;
    transition: background 0.15s;
}

.lang-dropdown button:hover {
    background: var(--accent-light);
}

.lang-dropdown button.active {
    color: var(--accent);
    font-weight: 600;
}

/* ===== Theme Toggle ===== */
.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 50%;
    transition: background 0.2s, color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.theme-toggle:hover {
    background: var(--accent-light);
    color: var(--accent);
}

.icon-moon { display: none; }
[data-theme="dark"] .icon-sun { display: none; }
[data-theme="dark"] .icon-moon { display: block; }

/* ===== Hero ===== */
.hero {
    text-align: center;
    padding: 80px 0 60px;
}

.hero-icon-wrapper {
    margin-bottom: 32px;
    position: relative;
    display: inline-block;
    padding: 40px 60px 48px;
}

.hero-icon {
    width: 120px;
    height: 120px;
    border-radius: 28px;
    position: relative;
    z-index: 2;
    transition: transform 0.4s ease, box-shadow 0.4s ease;
}

.hero-icon:hover { transform: scale(1.05) translateY(-4px); }

/* --- Light mode: leaf cradle --- */
.icon-leaf {
    position: absolute;
    bottom: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 160px;
    height: 48px;
    z-index: 1;
    /* Two overlapping leaf shapes */
    background:
        radial-gradient(ellipse 50% 80% at 35% 40%, rgba(45, 157, 143, 0.28) 0%, transparent 100%),
        radial-gradient(ellipse 50% 80% at 65% 40%, rgba(45, 157, 143, 0.22) 0%, transparent 100%);
    border-radius: 50%;
    transition: opacity var(--transition);
}

.icon-shadow {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    width: 100px;
    height: 16px;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.10) 0%, transparent 70%);
    border-radius: 50%;
    z-index: 0;
    transition: opacity var(--transition);
}

.icon-spotlight {
    display: none;
}

.hero-icon.light-only {
    box-shadow:
        0 10px 28px rgba(45, 157, 143, 0.18),
        0 2px 8px rgba(0, 0, 0, 0.06);
}

/* --- Dark mode: spotlight from above --- */
[data-theme="dark"] .icon-leaf { display: none; }
[data-theme="dark"] .icon-shadow { display: none; }

[data-theme="dark"] .icon-spotlight {
    display: block;
    position: absolute;
    top: -20px;
    left: 50%;
    transform: translateX(-50%);
    width: 240px;
    height: 200px;
    z-index: 0;
    /* Cone of light from top center */
    background: radial-gradient(
        ellipse 50% 70% at 50% 0%,
        rgba(90, 200, 190, 0.20) 0%,
        rgba(90, 200, 190, 0.08) 40%,
        transparent 80%
    );
    clip-path: polygon(35% 0%, 65% 0%, 90% 100%, 10% 100%);
    pointer-events: none;
}

[data-theme="dark"] .hero-icon.dark-only {
    box-shadow:
        0 0 48px rgba(90, 200, 190, 0.20),
        0 14px 36px rgba(0, 0, 0, 0.50),
        0 4px 12px rgba(0, 0, 0, 0.30);
}

[data-theme="dark"] .hero-icon:hover {
    box-shadow:
        0 0 64px rgba(90, 200, 190, 0.30),
        0 18px 44px rgba(0, 0, 0, 0.60),
        0 4px 12px rgba(0, 0, 0, 0.30);
}

.hero-title {
    font-size: 56px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: 24px;
    color: var(--text-secondary);
    font-weight: 400;
    margin-top: 4px;
    letter-spacing: 0.1em;
}

.hero-tagline {
    font-size: 18px;
    color: var(--text-secondary);
    margin-top: 20px;
    line-height: 1.6;
}

.coming-soon {
    display: inline-block;
    margin-top: 32px;
    padding: 10px 24px;
    background: var(--accent-light);
    color: var(--accent);
    border-radius: 100px;
    font-size: 14px;
    font-weight: 600;
}

/* ===== Preview ===== */
.preview {
    padding: 40px 0 60px;
}

.preview-scroll {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0 20px;
    scrollbar-width: none;
}

.preview-scroll::-webkit-scrollbar { display: none; }

.preview-slot {
    flex-shrink: 0;
    scroll-snap-align: center;
}

.phone-frame {
    width: 220px;
    height: 440px;
    background: var(--bg-secondary);
    border: 2px solid var(--border);
    border-radius: 32px;
    position: relative;
    overflow: hidden;
    transition: background var(--transition), border-color var(--transition);
}

.phone-notch {
    width: 100px;
    height: 28px;
    background: var(--bg-primary);
    border-radius: 0 0 16px 16px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
    transition: background var(--transition);
}

.phone-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    height: calc(100% - 28px);
    color: var(--text-tertiary);
    font-size: 14px;
    font-weight: 500;
}

/* ===== Section Title ===== */
.section-title {
    text-align: center;
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 48px;
}

/* ===== Features ===== */
.features { padding: 60px 0; }

.features-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

.feature-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 40px 28px 36px;
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s, box-shadow 0.3s, background var(--transition), border-color var(--transition);
}

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

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

.feature-illustration img {
    width: 96px;
    height: 96px;
    object-fit: contain;
}

.feature-card h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 12px;
    letter-spacing: -0.01em;
}

.feature-card p {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

/* ===== App Store Card ===== */
.app-store { padding: 40px 0; }

.store-card {
    display: flex;
    align-items: center;
    gap: 20px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 32px;
    box-shadow: var(--shadow-card);
    transition: background var(--transition), border-color var(--transition);
}

.store-icon-wrapper { flex-shrink: 0; }

.store-icon {
    width: 64px;
    height: 64px;
    border-radius: 16px;
}

.store-info { flex: 1; }
.store-info h3 { font-size: 17px; font-weight: 700; }
.store-info p { font-size: 14px; color: var(--text-secondary); margin-top: 2px; }
.store-meta { font-size: 13px; color: var(--text-tertiary); }

.store-button {
    flex-shrink: 0;
    padding: 10px 24px;
    background: var(--accent);
    color: #fff;
    border-radius: 100px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, transform 0.2s;
}

.store-button:hover {
    background: var(--accent-hover);
    transform: scale(1.03);
}

/* ===== Notify ===== */
.notify { padding: 60px 0; text-align: center; }

.notify-desc {
    color: var(--text-secondary);
    font-size: 15px;
    margin-bottom: 28px;
}

.notify-form {
    display: flex;
    gap: 12px;
    max-width: 440px;
    margin: 0 auto;
}

.notify-form input {
    flex: 1;
    padding: 14px 20px;
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s, background var(--transition), color var(--transition);
}

.notify-form input:focus { border-color: var(--accent); }

.notify-form button {
    padding: 14px 28px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-md);
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    white-space: nowrap;
}

.notify-form button:hover {
    background: var(--accent-hover);
    transform: scale(1.03);
}

.notify-success {
    display: none;
    margin-top: 16px;
    color: var(--accent);
    font-weight: 600;
    font-size: 15px;
}

.notify-success.show { display: block; }

/* ===== Privacy ===== */
.privacy { padding: 60px 0; }

.privacy-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 32px;
}

.privacy-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 28px 24px;
    text-align: center;
    box-shadow: var(--shadow-card);
    transition: background var(--transition), border-color var(--transition);
}

.privacy-icon { font-size: 32px; display: block; margin-bottom: 16px; }

.privacy-item p { font-size: 14px; color: var(--text-secondary); line-height: 1.6; }

.privacy-item strong {
    color: var(--text-primary);
    transition: color var(--transition);
}

/* ===== Footer ===== */
.site-footer {
    padding: 32px 0;
    border-top: 1px solid var(--border);
    transition: border-color var(--transition);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-left { display: flex; align-items: center; gap: 16px; }

.footer-copy {
    font-size: 13px;
    color: var(--text-tertiary);
}

.footer-links {
    display: flex;
    gap: 24px;
}

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

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

/* ===== Image Protection ===== */
img {
    -webkit-user-drag: none;
    user-select: none;
    -webkit-touch-callout: none;
    pointer-events: none;
}

.hero-icon-wrapper,
.feature-illustration,
.store-icon-wrapper {
    position: relative;
    user-select: none;
}

.hero-icon-wrapper::after,
.feature-illustration::after,
.store-icon-wrapper::after {
    content: '\00a9 Opifex Software';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: transparent;
    pointer-events: all;
    z-index: 2;
    text-shadow: 0 0 0 rgba(128, 128, 128, 0.03);
}

/* ===== Responsive — Tablet ===== */
@media (max-width: 960px) {
    .features-grid { grid-template-columns: repeat(2, 1fr); }
    .feature-card:nth-child(3) { grid-column: 1 / -1; max-width: 480px; margin: 0 auto; }
}

/* ===== Responsive — Mobile ===== */
@media (max-width: 640px) {
    .hero { padding: 56px 0 40px; }
    .hero-title { font-size: 40px; }
    .hero-subtitle { font-size: 20px; }
    .hero-icon { width: 96px; height: 96px; border-radius: 24px; }

    .section-title { font-size: 24px; margin-bottom: 32px; }

    .features-grid { grid-template-columns: 1fr; }
    .feature-card:nth-child(3) { max-width: none; }

    .privacy-grid { grid-template-columns: 1fr; gap: 16px; }

    .store-card {
        flex-direction: column;
        text-align: center;
        padding: 28px 24px;
    }

    .notify-form { flex-direction: column; }
    .notify-form button { width: 100%; }

    .phone-frame { width: 180px; height: 360px; }

    .footer-inner { flex-direction: column; gap: 16px; text-align: center; }
    .footer-left { flex-direction: column; gap: 4px; }
}

/* ===== Responsive — Desktop wide ===== */
@media (min-width: 1200px) {
    .container { max-width: 1120px; }
    .hero { padding: 100px 0 80px; }
    .hero-title { font-size: 64px; }
    .phone-frame { width: 240px; height: 480px; }
}

/* ===== Animations ===== */
@media (prefers-reduced-motion: no-preference) {
    .feature-card,
    .privacy-item,
    .store-card,
    .preview-slot {
        opacity: 0;
        transform: translateY(20px);
        animation: fadeUp 0.6s ease forwards;
    }

    .preview-slot:nth-child(1) { animation-delay: 0.05s; }
    .preview-slot:nth-child(2) { animation-delay: 0.1s; }
    .preview-slot:nth-child(3) { animation-delay: 0.15s; }
    .preview-slot:nth-child(4) { animation-delay: 0.2s; }

    .feature-card:nth-child(1) { animation-delay: 0.1s; }
    .feature-card:nth-child(2) { animation-delay: 0.2s; }
    .feature-card:nth-child(3) { animation-delay: 0.3s; }

    .privacy-item:nth-child(1) { animation-delay: 0.1s; }
    .privacy-item:nth-child(2) { animation-delay: 0.2s; }
    .privacy-item:nth-child(3) { animation-delay: 0.3s; }

    @keyframes fadeUp {
        to { opacity: 1; transform: translateY(0); }
    }
}
