:root {
    --bg:           #FAF8F5;
    --surface:      #FFFFFF;
    --text:         #1A1A1A;
    --text-muted:   #6B6B6B;
    --accent:       #C9913A;
    --accent-hover: #AE7A28;
    --border:       #E5E0D8;
    --radius:       14px;
    --shadow:       0 2px 20px rgba(0,0,0,0.07);
    --blur:         14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
}

/* ── Layout ── */
.site-header {
    text-align: center;
    padding: 60px 24px 36px;
}

.site-header h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 800;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 14px;
}

.site-header h1 span { color: var(--accent); }

.site-header p {
    font-size: 1.6rem;
    color: var(--text-muted);
    max-width: 480px;
    margin: 0 auto;
}

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px 100px;
}

/* ── Upload ── */
#upload-section { max-width: 560px; margin: 0 auto; }

#drop-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    background: var(--surface);
    transition: border-color .2s, background .2s;
    user-select: none;
    text-align: center;
    animation: drop-invite 3s ease-in-out infinite;
}

@keyframes drop-invite {
    0%, 100% { border-color: var(--border); }
    55%       { border-color: rgba(201, 145, 58, 0.55); }
}

#drop-zone:hover,
#drop-zone.drag-over {
    animation: none;
    border-color: var(--accent);
    background: #FFF8EF;
}

.drop-scheme {
    width: 100%;
    display: block;
    pointer-events: none;
}

.drop-cta-area {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.btn-upload {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 13px 28px;
    border-radius: 9px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    transition: background .15s, transform .1s;
    pointer-events: none; /* drop-zone click handler owns the click */
}

#drop-zone:hover .btn-upload  { background: var(--accent-hover); transform: translateY(-1px); }
#drop-zone:active .btn-upload { transform: translateY(0); }

.drop-hint { font-size: .82rem; color: var(--text-muted); }

/* ── Loading ── */
#loading-section { max-width: 1100px; margin: 0 auto; }

.loading-header {
    text-align: center;
    margin-bottom: 32px;
}

.spinner-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-bottom: 10px;
}

.spinner {
    width: 28px; height: 28px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .75s linear infinite;
    flex-shrink: 0;
}

@keyframes spin { to { transform: rotate(360deg); } }

#loading-message { color: var(--text-muted); font-size: .95rem; }

/* ── Grid ── */
.photo-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

/* ── Photo Card ── */
.photo-card {
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--surface);
    box-shadow: var(--shadow);
    position: relative;
}

.photo-card img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
    transition: filter .3s, transform .3s;
}

.card-label {
    padding: 10px 13px;
    font-size: .82rem;
    font-weight: 600;
    color: var(--text);
    background: var(--surface);
}

/* placeholder shimmer */
.photo-card.placeholder .card-img-wrap {
    aspect-ratio: 1;
    background: linear-gradient(90deg, #f0ece6 25%, #e6e0d6 50%, #f0ece6 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

.photo-card.placeholder .card-label {
    color: transparent;
    background: linear-gradient(90deg, #e6e2db 25%, #dad5cc 50%, #e6e2db 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 4px;
    margin: 10px 13px;
    height: 14px;
}

@keyframes shimmer {
    0%   { background-position:  200% 0; }
    100% { background-position: -200% 0; }
}

/* locked state */
.photo-card.locked { cursor: pointer; }

.photo-card.locked img {
    filter: blur(var(--blur));
    transform: scale(1.1);
}

.photo-card.locked:hover img {
    filter: blur(calc(var(--blur) - 5px));
}

.lock-overlay {
    position: absolute;
    inset: 0 0 38px 0;       /* exclude label area */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: rgba(0,0,0,.32);
    color: #fff;
    pointer-events: none;
}

.lock-icon  { font-size: 1.6rem; }
.lock-label { font-size: .75rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; opacity: .9; }

/* ── Unlock banner ── */
.unlock-banner {
    margin-top: 24px;
    background: var(--surface);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 22px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.unlock-text h3 { font-size: 1.05rem; font-weight: 700; margin-bottom: 3px; }
.unlock-text p  { font-size: .88rem; color: var(--text-muted); }

.btn-unlock {
    background: var(--accent);
    color: #fff;
    border: none;
    padding: 13px 26px;
    border-radius: 9px;
    font-size: .95rem;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    transition: background .15s, transform .1s;
    text-decoration: none;
    display: inline-block;
}

.btn-unlock:hover  { background: var(--accent-hover); transform: translateY(-1px); }
.btn-unlock:active { transform: translateY(0); }

/* ── Success banner ── */
.success-banner {
    background: #EAF7EE;
    border: 1px solid #A8D5B5;
    border-radius: var(--radius);
    padding: 16px 22px;
    color: #276036;
    font-weight: 600;
    text-align: center;
    margin-bottom: 24px;
}

/* ── Error ── */
#error-section {
    text-align: center;
    max-width: 460px;
    margin: 60px auto 0;
}

.error-emoji { font-size: 2.5rem; margin-bottom: 16px; }

#error-section h3 {
    font-size: 1.2rem;
    font-weight: 700;
    color: #B83232;
    margin-bottom: 8px;
}

#error-message { color: var(--text-muted); margin-bottom: 24px; line-height: 1.5; }

.btn-retry {
    background: var(--text);
    color: #fff;
    border: none;
    padding: 12px 28px;
    border-radius: 9px;
    font-size: .95rem;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.btn-retry:hover { background: #333; }

/* ── Responsive ── */
@media (max-width: 800px) {
    .photo-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
    .unlock-banner { flex-direction: column; text-align: center; }
    .btn-unlock { width: 100%; text-align: center; }
}

[hidden] { display: none !important; }

/* ── Guide article ── */
.guide-article {
    background: var(--surface);
    border-top: 1px solid var(--border);
    margin-top: 80px;
    padding: 72px 24px 96px;
}

.guide-inner {
    max-width: 740px;
    margin: 0 auto;
    font-size: 1.0625rem;
    line-height: 1.75;
    color: var(--text);
}

.guide-intro {
    font-size: 1.125rem;
    color: var(--text-muted);
    margin-bottom: 48px;
    line-height: 1.8;
}

.guide-inner h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin: 52px 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
    color: var(--text);
}

.guide-inner p  { margin-bottom: 16px; }
.guide-inner ul { margin: 12px 0 20px 0; padding-left: 1.4em; }
.guide-inner li { margin-bottom: 8px; }

/* FAQ */
.faq-list { margin: 0; padding: 0; }

.faq-item {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    margin-bottom: 12px;
}

.faq-item dt {
    font-weight: 700;
    font-size: 1rem;
    margin-bottom: 6px;
    color: var(--text);
}

.faq-item dd {
    margin: 0;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Try-tool CTA inside article */
.btn-try-tool {
    display: inline-block;
    margin: 8px 0 32px;
    background: var(--accent);
    color: #fff;
    padding: 14px 28px;
    border-radius: 9px;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    transition: background .15s, transform .1s;
}

.btn-try-tool:hover  { background: var(--accent-hover); transform: translateY(-1px); }
.btn-try-tool:active { transform: translateY(0); }

.guide-closing {
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-style: italic;
}
