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

body {
    font-family: 'Raleway', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #636363;
    background: #fff;
    line-height: 1.6;
    font-weight: 300;
    font-size: 16px;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s, background 0.2s, border-color 0.2s;
}

/* === Header / Banner === */
#header {
    background: linear-gradient(135deg, #a163a2 0%, #667eea 50%, #56ab6f 100%);
    padding: 4rem 2rem 3rem;
    text-align: center;
    color: #fff;
}

.header-content {
    max-width: 800px;
    margin: 0 auto;
}

.logo-icon {
    display: inline-block;
    margin-bottom: 0.5rem;
}

.logo-icon svg {
    width: 64px;
    height: 64px;
    animation: spin-slow 4s linear infinite;
}

@keyframes spin-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.site-title {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 0.5rem;
}

.site-desc {
    font-size: 1rem;
    font-weight: 300;
    opacity: 0.9;
    line-height: 1.8;
}

.site-note {
    margin-top: 0.85rem;
    font-size: 0.82rem;
    opacity: 0.8;
}

/* === Main Section === */
#main-section {
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
}

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

.section-header h2 {
    font-size: 1.8rem;
    font-weight: 300;
    color: #636363;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #ddd;
    position: relative;
}

.section-header h2::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 50%;
    transform: translateX(-50%);
    width: 200px;
    height: 2px;
    background: linear-gradient(90deg, #efa8b0, #a89cc8, #8cc9f0);
}

.section-header p {
    color: #999;
    font-size: 0.95rem;
    margin-top: 0.5rem;
}

/* === Form === */
.input-group {
    max-width: 600px;
    margin: 0 auto 1.5rem;
}

#username-input {
    width: 100%;
    padding: 0.9rem 1.25rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1.05rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 500;
    letter-spacing: 0;
    color: #262626;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

#username-input:focus {
    border-color: #a89cc8;
    box-shadow: 0 0 0 3px rgba(168, 156, 200, 0.15);
}

#username-input::placeholder {
    color: rgba(38, 38, 38, 0.48);
}

/* Turnstile */
#turnstile-container {
    display: none;
    justify-content: center;
    margin: 1rem auto;
}

.submit-group {
    margin-top: 1.5rem;
}

.loading-progress {
    max-width: 600px;
    margin: 1rem auto 0;
    text-align: left;
}

.loading-progress-track {
    width: 100%;
    height: 10px;
    border-radius: 999px;
    overflow: hidden;
    background: #e7ecf3;
    box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.06);
}

.loading-progress-fill {
    width: 0%;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(90deg, #efa8b0, #a89cc8, #45a7f8);
    transition: width 0.22s ease;
}

.loading-progress-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 0.55rem;
    color: #7c879a;
    font-size: 0.88rem;
}

/* === Buttons === */
.btn-primary {
    display: inline-block;
    padding: 0.85rem 2.5rem;
    background: #4acfc9;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
    text-decoration: none;
}

.btn-primary:hover {
    background: #3bbfb9;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-large {
    padding: 1rem 3rem;
    font-size: 1.1rem;
}

.btn-outline {
    display: inline-block;
    padding: 0.85rem 2.5rem;
    background: transparent;
    color: #636363;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.5px;
    border: 1px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    text-decoration: none;
}

.btn-outline:hover {
    background: rgba(0,0,0,0.02);
    border-color: #bbb;
}

#download-btn {
    display: inline-block;
    padding: 1rem 3rem;
    background: #4acfc9;
    color: #fff;
    font-size: 1.1rem;
    font-weight: 600;
    font-family: inherit;
    letter-spacing: 0.5px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.2s, transform 0.1s;
}

#download-btn:hover {
    background: #3bbfb9;
    transform: translateY(-1px);
}

#download-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* === Action Buttons (footer of main section) === */
.action-buttons {
    margin-top: 3rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

body.coupang-dock-open {
    padding-bottom: 190px;
}

.coupang-mobile-dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1200;
    padding: 0 0 calc(env(safe-area-inset-bottom, 0px) + 8px);
    background: linear-gradient(180deg, rgba(255,255,255,0), rgba(15,23,42,0.08));
}

.coupang-mobile-dock[hidden] {
    display: none;
}

.coupang-mobile-dock-inner {
    max-width: 360px;
    margin: 0 auto;
    padding: 0.8rem 0.85rem 0.7rem;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    background: rgba(255,255,255,0.98);
    box-shadow: 0 -18px 42px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(220, 227, 238, 0.92);
    border-bottom: 0;
}

.coupang-mobile-dock-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.55rem;
}

.coupang-mobile-dock-head strong {
    font-size: 0.92rem;
    font-weight: 700;
    color: #3f4c61;
}

.coupang-mobile-dock-close {
    flex: 0 0 auto;
    border: 1px solid #d8e0ec;
    background: #fff;
    color: #5a667a;
    border-radius: 999px;
    padding: 0.42rem 0.7rem;
    font-size: 0.74rem;
    font-weight: 700;
    cursor: pointer;
}

.coupang-slot-frame {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    overflow: hidden;
}

.coupang-widget-frame {
    display: block;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    border: 0;
    background: transparent;
}

.coupang-top-slot {
    width: 100%;
    max-width: 340px;
    margin: 0 auto 1.1rem;
    padding: 0.65rem 0.5rem 0.45rem;
    border-radius: 14px;
    background: linear-gradient(180deg, #ffffff, #f8fafc);
    border: 1px solid #e8edf5;
    box-shadow: 0 12px 30px rgba(28, 37, 60, 0.07);
}

.coupang-disclosure {
    color: #8792a5;
    font-size: 0.78rem;
    line-height: 1.65;
    text-align: center;
    margin-top: 0.45rem;
}

/* === Results === */
#results {
    margin: 3rem auto 0;
    max-width: 920px;
    padding: 0 0 1rem;
}

.results-heading {
    margin-bottom: 0.5rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.9rem;
    padding: 2.5rem 1rem 2rem;
    margin-bottom: 2.25rem;
    text-align: center;
}

.user-info.has-highlights {
    cursor: pointer;
}

.user-avatar-ring {
    width: 132px;
    height: 132px;
    border-radius: 50%;
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #bc1888);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4px;
    box-shadow: 0 18px 40px rgba(220, 39, 67, 0.14);
}

.user-avatar-ring img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: #fff;
}

.user-avatar-ring.placeholder {
    color: #8d97a8;
    background: linear-gradient(135deg, #f09433, #e6683c, #dc2743, #bc1888);
}

.user-avatar-ring.placeholder span {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eef1f6;
    font-size: 3rem;
    font-weight: 700;
}

.user-summary strong {
    display: block;
    font-size: 2.1rem;
    line-height: 1.1;
    font-weight: 300;
    letter-spacing: 0;
    color: #4f5665;
}

.story-count-line {
    margin-top: 0.6rem;
    font-size: 1.3rem;
    font-weight: 700;
    color: #2f3441;
}

.story-last-line {
    margin-top: 0.35rem;
    font-size: 0.98rem;
    color: #8a93a3;
}

.profile-highlight-cta {
    margin-top: 0.9rem;
    padding: 0.7rem 1.2rem;
    border: none;
    border-radius: 999px;
    background: linear-gradient(135deg, #4acfc9, #45a7f8);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 22px rgba(69, 167, 248, 0.16);
}

.highlight-archive,
.highlight-detail {
    margin-top: 2rem;
}

.highlight-section,
.highlight-detail-section {
    margin-top: 1.5rem;
}

.highlight-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.highlight-section-header h3 {
    font-size: 1.55rem;
    font-weight: 400;
    color: #4f5665;
}

.highlight-toggle {
    padding: 0.72rem 1.1rem;
    border: 1px solid #d7ddea;
    border-radius: 999px;
    background: #fff;
    color: #516074;
    font-size: 0.88rem;
    font-weight: 700;
    cursor: pointer;
}

.highlight-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 190px));
    gap: 1rem;
}

.highlight-card {
    padding: 0.8rem;
    border: 1px solid #edf0f5;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 12px 28px rgba(28, 37, 60, 0.08);
    text-align: left;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
}

.highlight-card:hover,
.highlight-card.active {
    transform: translateY(-3px);
    border-color: rgba(69, 167, 248, 0.45);
    box-shadow: 0 20px 36px rgba(28, 37, 60, 0.12);
}

.highlight-cover-wrap {
    aspect-ratio: 1;
    border-radius: 12px;
    overflow: hidden;
    background: #eff3f8;
}

.highlight-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.highlight-cover.placeholder {
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, #f5f7fb, #e8edf5);
}

.highlight-title {
    margin-top: 0.8rem;
    font-size: 0.98rem;
    font-weight: 700;
    color: #39465b;
}

.highlight-count {
    margin-top: 0.25rem;
    font-size: 0.84rem;
    color: #8a93a3;
}

.highlight-items-grid {
    margin-top: 1rem;
}

.media-grid-title {
    grid-column: 1 / -1;
    text-align: center;
    margin-bottom: 0.4rem;
}

.media-grid-title h3 {
    font-size: 2.65rem;
    font-weight: 300;
    line-height: 1.1;
    color: #5b6270;
}

.media-grid-title p {
    margin-top: 0.5rem;
    font-size: 0.98rem;
    color: #8a93a3;
}

.media-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 280px));
    justify-content: center;
    gap: 2rem 2.25rem;
}

.media-card {
    background: #fff;
    border-radius: 18px;
    border: 1px solid #edf0f5;
    padding: 1.35rem 1.35rem 1.1rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    box-shadow: 0 18px 36px rgba(28, 37, 60, 0.08);
}

.media-card:hover {
    transform: translateY(-4px);
    border-color: rgba(168, 156, 200, 0.35);
    box-shadow: 0 24px 48px rgba(28, 37, 60, 0.12);
}

.media-frame {
    min-height: 380px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem;
    border-radius: 14px;
    background:
        linear-gradient(180deg, rgba(248,249,252,0.96), rgba(238,241,247,0.96));
}

.media-card img,
.media-card video {
    width: 100%;
    max-width: 236px;
    max-height: 420px;
    margin: 0 auto;
    display: block;
    border-radius: 12px;
    object-fit: cover;
    background: #0d0f14;
}

.media-meta {
    margin-top: 1rem;
}

.media-type-line {
    font-size: 0.92rem;
    font-weight: 700;
    color: #424a58;
}

.media-time-line {
    margin-top: 0.25rem;
    font-size: 0.92rem;
    color: #8a93a3;
}

.media-card .download-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    margin-top: 1rem;
    padding: 0.95rem 1.25rem;
    background: linear-gradient(135deg, #4acfc9, #45a7f8);
    border-radius: 12px;
    text-decoration: none;
    color: #fff;
    font-weight: 600;
    font-size: 0.96rem;
    letter-spacing: 0;
    box-shadow: 0 14px 24px rgba(69, 167, 248, 0.18);
}

.media-card .download-link:hover {
    background: linear-gradient(135deg, #40c3bd, #3f9bf0);
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 2.4rem 1.5rem;
    border: 1px dashed #d6dce6;
    border-radius: 16px;
    background: linear-gradient(180deg, #fafbfd, #f3f6fb);
    color: #8892a3;
    font-weight: 600;
}

/* === How To Section === */
#howto {
    padding: 4rem 2rem;
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
    border-top: 1px solid #eee;
}

.steps-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
    text-align: center;
}

.step-item {
    font-size: 0.95rem;
    color: #999;
    line-height: 1.6;
}

.start-btn-wrap {
    margin-top: 2rem;
}

/* === FAQ Section === */
#faq {
    padding: 4rem 2rem;
    background: #f7f7f7;
    border-top: 1px solid #eee;
}

.faq-container {
    max-width: 800px;
    margin: 0 auto;
}

.faq-title {
    text-align: center;
    font-size: 1rem;
    color: #999;
    margin-bottom: 2.5rem;
    letter-spacing: 1px;
}

.faq-item {
    margin-bottom: 2.5rem;
}

.faq-item h3 {
    font-size: 1.4rem;
    font-weight: 300;
    color: #636363;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    position: relative;
    text-align: center;
}

.faq-item h3::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 150px;
    height: 2px;
    background: linear-gradient(90deg, #efa8b0, #a89cc8, #8cc9f0);
}

.faq-item p {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.8;
    text-align: justify;
}

/* === Footer === */
#footer {
    background: linear-gradient(135deg, #a163a2 0%, #667eea 50%, #56ab6f 100%);
    padding: 3rem 2rem;
    color: rgba(255,255,255,0.85);
}

.footer-content {
    max-width: 800px;
    margin: 0 auto;
}

.footer-about h3 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.75rem;
}

.footer-about p {
    font-size: 0.9rem;
    line-height: 1.8;
    opacity: 0.85;
}

.footer-trust {
    margin-top: 1.75rem;
    text-align: center;
}

.footer-trust h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 0.5rem;
}

.footer-trust p {
    margin: 0.35rem 0;
    font-size: 0.9rem;
    line-height: 1.7;
    opacity: 0.88;
}

.footer-trust a {
    color: rgba(255,255,255,0.92);
    text-decoration: underline;
    text-underline-offset: 0.18rem;
}

.footer-bottom {
    margin-top: 1.25rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255,255,255,0.2);
    text-align: center;
    font-size: 0.8rem;
    opacity: 0.7;
}

.language-links {
    margin-top: 1.75rem;
    line-height: 1.9;
    text-align: center;
    font-size: 0.92rem;
}

.language-links a {
    color: rgba(255,255,255,0.82);
}

.language-links a:hover,
.language-links a.active {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 0.18rem;
}

.footer-links {
    margin-top: 0.85rem;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.6rem 1rem;
    font-size: 0.88rem;
}

.footer-links a {
    color: rgba(255,255,255,0.92);
    text-decoration: underline;
    text-underline-offset: 0.18rem;
}

.guides-section {
    padding: 1rem 2rem 4rem;
    max-width: 1000px;
    margin: 0 auto;
}

.guides-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.25rem;
    margin-top: 2rem;
}

.guide-card {
    border: 1px solid #e3e7ef;
    border-radius: 6px;
    padding: 1.4rem 1.35rem;
    text-align: left;
    background: #fff;
}

.guide-card h3 {
    font-size: 1.08rem;
    font-weight: 600;
    color: #4a4a4a;
    margin-bottom: 0.55rem;
}

.guide-card p {
    font-size: 0.94rem;
    color: #6b7483;
    line-height: 1.75;
}

.guide-card a {
    display: inline-block;
    margin-top: 0.9rem;
    font-size: 0.88rem;
    font-weight: 600;
    color: #4acfc9;
}

.doc-page {
    min-height: 100vh;
    background: #f8fafc;
}

.doc-shell {
    max-width: 940px;
    margin: 0 auto;
    padding: 3rem 1.5rem 4rem;
}

.doc-topbar {
    margin-bottom: 1.5rem;
}

.doc-topbar a {
    font-size: 0.9rem;
    color: #627089;
}

.doc-hero {
    background: #fff;
    border: 1px solid #e5e9f2;
    border-radius: 6px;
    padding: 2rem 2rem 1.6rem;
    margin-bottom: 1.25rem;
}

.doc-hero h1 {
    font-size: 2rem;
    line-height: 1.25;
    font-weight: 600;
    color: #3d4656;
    margin-bottom: 0.8rem;
}

.doc-hero p {
    font-size: 0.98rem;
    line-height: 1.8;
    color: #6b7483;
}

.doc-body {
    background: #fff;
    border: 1px solid #e5e9f2;
    border-radius: 6px;
    padding: 2rem;
}

.doc-body section + section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #edf1f6;
}

.doc-body h2 {
    font-size: 1.25rem;
    font-weight: 600;
    color: #424d61;
    margin-bottom: 0.85rem;
}

.doc-body h3 {
    font-size: 1rem;
    font-weight: 600;
    color: #49546a;
    margin: 1rem 0 0.45rem;
}

.doc-body p {
    font-size: 0.96rem;
    line-height: 1.85;
    color: #5f6b80;
}

.doc-body ul,
.doc-body ol {
    padding-left: 1.25rem;
    margin-top: 0.7rem;
}

.doc-body li {
    margin-top: 0.45rem;
    color: #5f6b80;
    line-height: 1.8;
}

.doc-callout {
    margin-top: 1rem;
    padding: 1rem 1.1rem;
    border-left: 3px solid #4acfc9;
    background: #f4fbfc;
    color: #4f6478;
    font-size: 0.92rem;
    line-height: 1.8;
}

.doc-related {
    margin-top: 2rem;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.doc-related a {
    display: block;
    padding: 1rem 1.1rem;
    border: 1px solid #e5e9f2;
    border-radius: 6px;
    background: #fafbfd;
}

.doc-related strong {
    display: block;
    margin-bottom: 0.35rem;
    color: #424d61;
    font-size: 0.96rem;
}

.doc-related span {
    font-size: 0.88rem;
    line-height: 1.65;
    color: #6c788e;
}

/* === Loading === */
.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(0,0,0,0.1);
    border-top-color: #4acfc9;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* === Error / Info Messages === */
.error-message {
    text-align: center;
    padding: 2rem;
    color: #e74c3c;
    font-weight: 600;
}

.info-message {
    text-align: center;
    padding: 2rem;
    color: #636363;
    font-weight: 400;
}

/* === Responsive === */
@media (max-width: 736px) {
    .site-title { font-size: 2.2rem; }
    #header { padding: 3rem 1.5rem 2rem; }

    #main-section { padding: 2.5rem 1.5rem; }
    
    .section-header h2 { font-size: 1.4rem; }
    
    .action-buttons {
        flex-direction: column;
        align-items: center;
    }

    .guides-grid,
    .doc-related {
        grid-template-columns: 1fr;
    }

    .doc-hero,
    .doc-body {
        padding: 1.4rem;
    }

    body.coupang-dock-open {
        padding-bottom: 176px;
    }
    
    .steps-row {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .faq-item h3 { font-size: 1.2rem; }
    .user-avatar-ring {
        width: 112px;
        height: 112px;
    }
    .user-summary strong {
        font-size: 1.7rem;
    }
    .story-count-line {
        font-size: 1.1rem;
    }
    .media-grid-title h3 {
        font-size: 2rem;
    }
    .media-grid {
        grid-template-columns: minmax(0, 1fr);
    }
    .media-frame {
        min-height: 0;
    }
    .media-card img,
    .media-card video {
        max-width: 100%;
        max-height: none;
    }
}

@media (max-width: 480px) {
    .site-title { font-size: 1.8rem; }
    #main-section { padding: 2rem 1rem; }
    #download-btn { padding: 0.85rem 2rem; font-size: 1rem; }
}
