:root {
    --bg: #f5f6fb;
    --bg-elevated: #ffffff;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-border: rgba(15, 23, 42, 0.08);
    --text: #0f172a;
    --text-muted: #475569;
    --text-subtle: #64748b;
    --shadow-sm: 0 4px 16px rgba(15, 23, 42, 0.06);
    --shadow-md: 0 10px 30px rgba(15, 23, 42, 0.08);
    --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.12);
    --accent: #6366f1;
    --accent-2: #a855f7;
    --accent-3: #ec4899;
    --accent-soft: rgba(99, 102, 241, 0.12);
    --radius-sm: 10px;
    --radius-md: 16px;
    --radius-lg: 24px;
    --gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
    --blob-1: #a5b4fc;
    --blob-2: #f0abfc;
    --blob-3: #fda4af;
}

body.dark {
    --bg: #070816;
    --bg-elevated: #111227;
    --surface: rgba(17, 18, 39, 0.72);
    --surface-border: rgba(148, 163, 184, 0.12);
    --text: #f1f5f9;
    --text-muted: #cbd5e1;
    --text-subtle: #94a3b8;
    --shadow-sm: 0 4px 16px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 10px 30px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.6);
    --accent: #818cf8;
    --accent-2: #c084fc;
    --accent-3: #f472b6;
    --accent-soft: rgba(129, 140, 248, 0.18);
    --blob-1: #4338ca;
    --blob-2: #7e22ce;
    --blob-3: #be185d;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
    margin: 0;
    min-height: 100vh;
    background-color: var(--bg);
    color: var(--text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    transition: background-color 0.5s ease, color 0.3s ease;
    overflow-x: hidden;
}

/* Decorative background blobs */
.bg-blobs {
    position: fixed;
    inset: 0;
    z-index: -1;
    overflow: hidden;
    pointer-events: none;
}

.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    transition: background 0.6s ease, opacity 0.6s ease;
}

.blob-1 { width: 420px; height: 420px; background: var(--blob-1); top: -120px; left: -80px; animation: float 18s ease-in-out infinite; }
.blob-2 { width: 500px; height: 500px; background: var(--blob-2); top: 20%; right: -150px; animation: float 22s ease-in-out infinite reverse; }
.blob-3 { width: 380px; height: 380px; background: var(--blob-3); bottom: -100px; left: 30%; animation: float 26s ease-in-out infinite; }

body.dark .blob { opacity: 0.35; }

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(30px, -40px) scale(1.08); }
}

/* Header */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 22px 32px;
    max-width: 1200px;
    margin: 0 auto;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-weight: 700;
    font-size: 20px;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.logo-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: var(--gradient);
    color: white;
    font-size: 20px;
    box-shadow: var(--shadow-sm);
}

.logo-text span {
    background: var(--gradient);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* Theme toggle */
.theme-toggle {
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    border-radius: 999px;
}

.theme-toggle-track {
    position: relative;
    display: block;
    width: 60px;
    height: 32px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.06);
    transition: background 0.3s ease;
}

.theme-toggle-thumb {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: var(--gradient);
    border-radius: 50%;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.45);
}

body.dark .theme-toggle-thumb { left: 33px; }

.icon { width: 14px; height: 14px; position: absolute; transition: opacity 0.25s ease, transform 0.25s ease; }
.icon-sun { opacity: 1; }
.icon-moon { opacity: 0; transform: rotate(-90deg); }
body.dark .icon-sun { opacity: 0; transform: rotate(90deg); }
body.dark .icon-moon { opacity: 1; transform: rotate(0); }

/* Hero */
.hero {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 32px 72px;
    text-align: center;
}

.hero-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 8px 16px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    font-size: 14px;
    color: var(--text-muted);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    margin-bottom: 28px;
}

.pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.55); }
    70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.02em;
    margin: 0 0 20px;
}

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

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.15rem);
    color: var(--text-muted);
    max-width: 620px;
    margin: 0 auto 36px;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 24px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
    background: var(--gradient);
    color: white;
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.5);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 30px -5px rgba(99, 102, 241, 0.55);
}

.btn-ghost {
    background: var(--surface);
    color: var(--text);
    border-color: var(--surface-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.btn-ghost:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

/* Sections */
.section {
    max-width: 1100px;
    margin: 0 auto;
    padding: 48px 32px;
}

.section-head {
    text-align: center;
    margin-bottom: 36px;
}

.section-head h2 {
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    font-weight: 700;
    letter-spacing: -0.01em;
    margin: 0 0 8px;
}

.section-head p {
    color: var(--text-muted);
    margin: 0;
}

/* Calendar grid */
.calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.calendar-card {
    display: flex;
    flex-direction: column;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    text-decoration: none;
    color: inherit;
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    box-shadow: var(--shadow-sm);
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s ease,
                border-color 0.3s ease;
    position: relative;
}

.calendar-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
    border-color: var(--accent-soft);
}

.calendar-card.is-coming {
    opacity: 0.75;
    cursor: not-allowed;
}

.calendar-card.is-coming:hover {
    transform: none;
    box-shadow: var(--shadow-sm);
}

.calendar-preview {
    position: relative;
    aspect-ratio: 16 / 10;
    overflow: hidden;
    background: linear-gradient(135deg, var(--accent-soft), transparent);
}

.calendar-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.6s ease;
}

.calendar-card:hover .calendar-preview img {
    transform: scale(1.06);
}

.card-badge {
    position: absolute;
    top: 14px;
    left: 14px;
    padding: 6px 12px;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    letter-spacing: 0.02em;
}

.badge-soon {
    background: rgba(148, 163, 184, 0.85);
}

.badge-nsfw {
    background: linear-gradient(135deg, #ec4899, #a855f7);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.35);
}

/* NSFW card: blur the preview until hovered (prevents accidental exposure) */
.calendar-card-nsfw .calendar-preview-img {
    filter: blur(22px) saturate(0.9);
    transform: scale(1.1);
    transition: filter 0.35s ease, transform 0.6s ease;
}

.calendar-card-nsfw:hover .calendar-preview-img,
.calendar-card-nsfw:focus-within .calendar-preview-img {
    filter: blur(0);
    transform: scale(1.04);
}

.calendar-card-nsfw .calendar-preview::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.18), rgba(168, 85, 247, 0.18));
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.calendar-card-nsfw:hover .calendar-preview::after {
    opacity: 0;
}

.age-tag {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #ec4899, #a855f7);
    color: white;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    border-radius: 6px;
    vertical-align: middle;
}

.meta-tag-nsfw {
    background: linear-gradient(135deg, rgba(236, 72, 153, 0.18), rgba(168, 85, 247, 0.18));
    color: #db2777;
    border: 1px solid rgba(236, 72, 153, 0.3);
}

body.dark .meta-tag-nsfw {
    color: #f9a8d4;
}

.calendar-body {
    padding: 22px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex: 1;
}

.calendar-title {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: -0.01em;
}

.calendar-desc {
    color: var(--text-muted);
    font-size: 14.5px;
    flex: 1;
}

.calendar-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding-top: 14px;
    border-top: 1px solid var(--surface-border);
    font-size: 13px;
}

.meta-tag {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: var(--accent-soft);
    color: var(--accent);
    border-radius: 999px;
    font-weight: 500;
}

body.dark .meta-tag { color: var(--text); }

.meta-open {
    color: var(--accent);
    font-weight: 600;
    transition: transform 0.2s ease;
}

.calendar-card:hover .meta-open {
    transform: translateX(4px);
}

/* Features */
.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.feature-card {
    padding: 28px;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-md);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    transition: transform 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-soft);
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.feature-card h3 {
    margin: 0 0 6px;
    font-size: 18px;
    font-weight: 700;
}

.feature-card p {
    margin: 0;
    color: var(--text-muted);
    font-size: 14.5px;
}

/* Footer */
.site-footer {
    margin-top: 40px;
    padding: 32px 24px 40px;
    border-top: 1px solid var(--surface-border);
}

.footer-inner {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    color: var(--text-subtle);
    font-size: 13px;
}

.footer-brand {
    font-weight: 600;
    color: var(--text-muted);
    margin: 0 0 8px;
}

.footer-contact {
    margin: 0 0 8px;
}

.footer-contact a {
    color: var(--text-muted);
    text-decoration: none;
    border-bottom: 1px solid var(--surface-border);
    transition: color .2s ease, border-color .2s ease;
}

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

.footer-note {
    margin: 0;
    line-height: 1.6;
}

/* Responsive */
@media (max-width: 600px) {
    .site-header { padding: 18px 20px; }
    .hero { padding: 32px 20px 48px; }
    .section { padding: 36px 20px; }
}

/* URL generator */
.generator-card {
    max-width: 820px;
    margin: 0 auto;
    background: var(--surface);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 28px;
    display: grid;
    gap: 24px;
}

.generator-form {
    display: grid;
    gap: 18px;
}

.form-row {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-label,
.form-row > label:not(.checkbox-row) {
    font-weight: 600;
    font-size: 14px;
    color: var(--text-muted);
    letter-spacing: 0.01em;
}

.generator-card select,
.generator-card input[type="text"] {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--surface-border);
    background: var(--bg-elevated);
    color: var(--text);
    font-family: inherit;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.generator-card select:focus,
.generator-card input[type="text"]:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

.segmented {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 4px;
    background: var(--bg-elevated);
    border: 1px solid var(--surface-border);
    border-radius: 999px;
    align-self: flex-start;
}

.segmented label {
    position: relative;
    cursor: pointer;
}

.segmented input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.segmented span {
    display: inline-block;
    padding: 8px 16px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-muted);
    transition: background 0.2s ease, color 0.2s ease;
}

.segmented input:checked + span {
    background: var(--gradient);
    color: #fff;
}

.segmented label:hover span {
    color: var(--text);
}

.segmented input:checked + span:hover {
    color: #fff;
}

.checkbox-row {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-weight: 500;
    color: var(--text);
    font-size: 15px;
}

.checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: var(--accent);
    cursor: pointer;
}

.form-divider {
    height: 1px;
    background: var(--surface-border);
    margin: 6px 0 2px;
    border: 0;
}

.form-hint {
    font-size: 12px;
    color: var(--text-subtle);
    line-height: 1.45;
}

.generator-output {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 20px;
    border-top: 1px solid var(--surface-border);
}

.url-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: stretch;
}

.url-row input[type="text"] {
    flex: 1 1 280px;
    font-family: 'SFMono-Regular', Menlo, Consolas, monospace;
    font-size: 13px;
}

.url-row .btn {
    padding: 10px 18px;
    font-size: 14px;
}

.generator-hint {
    margin: 0;
    font-size: 13px;
    color: var(--text-subtle);
}

.output-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 24px;
    align-items: start;
}

.output-left {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 0;
}

.output-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: 14px;
    background: #ffffff;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

.output-qr img {
    display: block;
    width: 180px;
    height: 180px;
    image-rendering: pixelated;
}

.qr-caption {
    margin: 0;
    font-size: 12px;
    color: #475569;
    max-width: 180px;
    text-align: center;
    line-height: 1.4;
}

@media (max-width: 620px) {
    .output-grid {
        grid-template-columns: 1fr;
        justify-items: center;
    }
    .output-left { width: 100%; }
}

@media (max-width: 560px) {
    .generator-card { padding: 20px; }
    .url-row .btn { flex: 1 1 auto; justify-content: center; }
}

/* Respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
