/* ==========================================================================
   Atelier Zero — Instagram Friendship Checker
   Mobile-First Editorial CSS
   ========================================================================== */

:root {
    --paper: #efe7d2;
    --paper-warm: #ece4cf;
    --paper-dark: #ddd2b6;
    --bone: #f7f1de;
    --ink: #15140f;
    --ink-soft: #2a2620;
    --ink-mute: #5a5448;
    --ink-faint: #8b8676;
    --coral: #ed6f5c;
    --coral-soft: #f08e7c;
    --mustard: #e9b94a;
    --olive: #6e7448;

    --font-display: 'Inter Tight', 'Inter', -apple-system, sans-serif;
    --font-serif: 'Playfair Display', Georgia, serif;
    --font-body: 'Inter', -apple-system, system-ui, sans-serif;
    --font-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;

    --radius-card: 18px;
    --radius-pill: 999px;
    --shadow-card: 0 30px 60px -30px rgba(21,20,15,0.12), 0 0 0 1px rgba(21,20,15,0.06);
    --shadow-btn: 0 14px 26px -16px rgba(237,111,92,0.45);
    --ease: 0.18s ease;
}

/* ---- Base & Reset ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--paper);
    color: var(--ink);
}
body {
    font-family: var(--font-body);
    font-weight: 400;
    line-height: 1.55;
    min-height: 100vh;
    overflow-x: hidden;
}
img, svg { display: block; }
a { color: inherit; text-decoration: none; }
code {
    font-family: var(--font-mono);
    font-size: 0.8em;
    background: rgba(21,20,15,0.05);
    padding: 0.1em 0.4em;
    border-radius: 3px;
    color: var(--ink-soft);
}
strong { font-weight: 600; }

/* ---- Paper Noise Overlay ---- */
.paper-noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 9999;
    mix-blend-mode: multiply;
    opacity: 0.06;
    background: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)' opacity='1'/%3E%3C/svg%3E");
}

/* ---- Side Rails (hidden on mobile) ---- */
.rail {
    display: none;
}

/* ---- Top Metadata Strip ---- */
.meta-strip {
    border-bottom: 1px solid rgba(21,20,15,0.12);
    font-family: var(--font-display);
    font-size: 9px;
    font-weight: 600;
    color: var(--ink-faint);
    padding: 4px 0;
    letter-spacing: 0.02em;
}
.meta-strip-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 4px;
    padding: 0 24px;
    max-width: 1360px;
    margin: 0 auto;
}
.meta-filed strong { color: var(--ink-mute); }
.meta-status {
    display: flex;
    align-items: center;
    gap: 4px;
}
.pulse-dot {
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--coral);
    animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.35; }
}

/* ---- Navigation (sticky) ---- */
.nav {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--paper);
    border-bottom: 1px solid rgba(21,20,15,0.08);
}
.nav-inner {
    max-width: 1360px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 56px;
}
.brand-mark {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 24px;
    color: var(--ink);
    line-height: 1;
}
.nav-links {
    display: flex;
    gap: 20px;
    align-items: center;
}
.nav-link {
    font-family: var(--font-display);
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-mute);
    transition: color var(--ease);
}
.nav-link:hover { color: var(--ink); }
.nav-cta { color: var(--coral) !important; font-weight: 700; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 14px;
    padding: 12px 20px;
    border-radius: var(--radius-pill);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all var(--ease);
    white-space: nowrap;
    touch-action: manipulation;
}
.btn-primary {
    background: var(--coral);
    color: #fff;
    box-shadow: var(--shadow-btn);
}
.btn-primary:hover:not(:disabled) { background: var(--coral-soft); transform: translateY(-1px); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; box-shadow: none; }
.btn-ghost {
    background: transparent;
    border-color: rgba(21,20,15,0.2);
    color: var(--ink);
}
.btn-ghost:hover { background: rgba(21,20,15,0.03); transform: translateY(-1px); }

/* ---- Hero ---- */
.hero {
    padding: 64px 24px 48px;
}
.hero-inner {
    max-width: 960px;
    margin: 0 auto;
}
.hero-headline {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(36px, 10vw, 90px);
    line-height: 1.05;
    letter-spacing: -0.03em;
    color: var(--ink);
    margin-bottom: 20px;
}
.hero-headline .sans { font-weight: 800; }
.hero-headline .serif {
    font-family: var(--font-serif);
    font-style: italic;
    font-weight: 500;
}
.dot { color: var(--coral); }
.hero-sub {
    font-size: 16px;
    line-height: 1.6;
    color: var(--ink-soft);
    max-width: 600px;
    margin-bottom: 28px;
}

/* ---- Section Rules (Roman) ---- */
.sec-rule {
    border-top: 1px solid rgba(21,20,15,0.12);
    padding: 14px 24px 6px;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    font-family: var(--font-serif);
    font-size: 13px;
    color: var(--coral);
    max-width: 1360px;
    margin: 0 auto;
}
.sec-rule .roman { font-style: italic; font-weight: 500; }
.sec-rule .rule-meta {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-faint);
}
.sec-rule .rule-page {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 600;
    color: var(--ink-faint);
}

/* ---- Sections ---- */
.section {
    padding: 64px 24px;
}
.section-inner {
    max-width: 1360px;
    margin: 0 auto;
}
.section-head {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(28px, 5vw, 54px);
    letter-spacing: -0.02em;
    color: var(--ink);
    margin-bottom: 24px;
}
.section-head .dot { color: var(--coral); }
.section-intro {
    font-size: 15px;
    color: var(--ink-soft);
    margin-bottom: 32px;
    line-height: 1.6;
    max-width: 640px;
}
.method-subhead {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 18px;
    color: var(--ink);
    margin-bottom: 16px;
    margin-top: 12px;
}

/* ---- Method Grid (Steps) ---- */
.method-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 16px;
}
.method-step {
    position: relative;
}
.step-head {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 15px;
    color: var(--ink);
    margin-bottom: 8px;
    border-top: 2px solid transparent;
    padding-top: 8px;
    border-color: var(--ink);
}
.step-num {
    font-family: var(--font-serif);
    font-style: italic;
    color: var(--coral);
    margin-right: 2px;
}
.step-arrow { color: var(--ink-faint); }
.step-title { flex: 1; }
.step-desc {
    font-size: 14px;
    line-height: 1.5;
    color: var(--ink-soft);
}

/* ---- Cards & Upload ---- */
.upload-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-bottom: 32px;
}
.card {
    background: var(--bone);
    border-radius: var(--radius-card);
    padding: 22px 20px;
    box-shadow: var(--shadow-card);
    display: flex;
    gap: 14px;
    align-items: flex-start;
    transition: transform var(--ease), box-shadow var(--ease);
}
.card:hover { transform: translateY(-3px); box-shadow: 0 36px 72px -30px rgba(21,20,15,0.18), 0 0 0 1px rgba(21,20,15,0.08); }
.card-num {
    font-family: var(--font-serif);
    font-style: italic;
    font-size: 20px;
    color: var(--coral);
    line-height: 1;
}
.card-content { flex: 1; }
.card-eyebrow {
    font-family: var(--font-display);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--ink-faint);
    display: block;
    margin-bottom: 4px;
}
.card-file { font-size: 12px; color: var(--ink-mute); margin-bottom: 12px; }
.upload-zone {
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px dashed rgba(21,20,15,0.25);
    border-radius: 8px;
    padding: 14px 16px;
    cursor: pointer;
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 14px;
    color: var(--ink-soft);
    transition: border-color var(--ease);
    touch-action: manipulation;
}
.upload-zone:hover { border-color: var(--coral); }
.upload-status {
    margin-top: 8px;
    font-size: 12px;
    min-height: 18px;
    color: var(--ink-mute);
}
.upload-status.success { color: var(--olive); }
.upload-status.error { color: var(--coral); }
.card-arrow {
    font-size: 18px;
    color: var(--ink-faint);
    transition: color var(--ease);
}
.card:hover .card-arrow { color: var(--coral); }
.action-bar {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
}

/* ---- Stats Rings ---- */
.stats-row {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}
.stat-ring {
    width: 80px; height: 80px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--bone);
    box-shadow: inset 0 0 0 1px rgba(21,20,15,0.08);
    font-family: var(--font-display);
}
.stat-ring .ring-val {
    font-size: 24px;
    font-weight: 800;
    color: var(--ink);
}
.stat-ring .ring-label {
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: var(--ink-faint);
    text-transform: uppercase;
    margin-top: 2px;
    text-align: center;
}
.stat-ring.highlight { box-shadow: inset 0 0 0 2px var(--coral); }

/* ---- Pill Tabs ---- */
.tab-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: var(--radius-pill);
    border: 1px solid rgba(21,20,15,0.15);
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 13px;
    color: var(--ink-soft);
    background: transparent;
    cursor: pointer;
    transition: all var(--ease);
    touch-action: manipulation;
}
.pill:hover { background: rgba(21,20,15,0.03); }
.tab--active {
    background: var(--coral) !important;
    border-color: var(--coral);
    color: #fff;
}
.pill-count { opacity: 0.7; }

/* ---- Results Panel ---- */
.results-panel {
    background: var(--bone);
    border-radius: var(--radius-card);
    box-shadow: var(--shadow-card);
    max-height: 480px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.results-list { padding: 4px 0; }
.result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 16px;
    font-size: 14px;
    color: var(--ink-soft);
    transition: background 0.15s;
    border-bottom: 1px solid rgba(21,20,15,0.04);
}
.result-item:last-child { border-bottom: none; }
.result-item:hover { background: rgba(21,20,15,0.03); }
.result-avatar {
    width: 30px; height: 30px;
    border-radius: 50%;
    background: var(--paper-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.result-username {
    font-weight: 500;
    color: var(--ink);
    word-break: break-word;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color var(--ease);
}
.result-username:hover {
    color: var(--coral);
    text-decoration: underline;
}
.username-link-arrow {
    font-size: 11px;
    opacity: 0.5;
    transition: transform var(--ease), opacity var(--ease);
}
.result-username:hover .username-link-arrow {
    opacity: 1;
    transform: translate(1px, -1px);
}
.result-empty {
    padding: 48px 16px;
    text-align: center;
    color: var(--ink-faint);
    font-size: 15px;
}

/* ---- Footer ---- */
.footer {
    padding: 64px 24px;
    border-top: 1px solid rgba(21,20,15,0.1);
}
.footer-inner {
    max-width: 1360px;
    margin: 0 auto;
    text-align: center;
}
.footer-word {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(48px, 12vw, 200px);
    letter-spacing: -0.04em;
    color: var(--ink);
    line-height: 1;
    margin-bottom: 12px;
    word-break: break-word;
}
.footer-meta {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
    font-family: var(--font-mono);
    font-size: 10px;
    color: var(--ink-faint);
    margin-bottom: 16px;
}
.footer-pulse { margin: 0 auto; }

/* ---- Reveal Animations (untuk scroll) ---- */
.reveal {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.reveal--visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---- Media Queries ---- */

/* Tablet kecil ke atas (>=560px) */
@media (min-width: 560px) {
    .meta-strip { font-size: 10px; }
    .meta-strip-inner { padding: 0 32px; }
    .nav-inner { padding: 0 32px; height: 60px; }
    .hero { padding: 80px 32px 64px; }
    .section { padding: 80px 32px; }
    .sec-rule { padding-left: 32px; padding-right: 32px; }
    .card { padding: 26px 24px; }
    .upload-zone { padding: 16px 18px; }
    .method-grid { grid-template-columns: 1fr 1fr; gap: 32px 24px; }
    .method-step { border-top: none; }
    .step-head { border-top: 2px solid var(--ink); margin-top: 0; padding-top: 10px; }
    .stat-ring { width: 90px; height: 90px; }
}

/* Tablet besar (>=880px) */
@media (min-width: 880px) {
    .nav-inner { padding: 0 44px; height: 64px; }
    .hero { padding: 100px 44px 80px; }
    .section { padding: 100px 44px; }
    .sec-rule { padding-left: 44px; padding-right: 44px; }
    .upload-grid { grid-template-columns: 1fr 1fr; }
    .method-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Desktop kecil (>=1080px) */
@media (min-width: 1080px) {
    .nav-inner { padding: 0 44px; }
    .section { padding: 130px 44px; }
    .sec-rule { padding-left: 44px; padding-right: 44px; }
    .method-grid { grid-template-columns: repeat(4, 1fr); }
}

/* Desktop penuh (>=1280px) */
@media (min-width: 1280px) {
    .rail {
        display: flex;
        position: fixed;
        top: 0; bottom: 0;
        width: 36px;
        align-items: flex-end;
        justify-content: center;
        writing-mode: vertical-rl;
        font-family: var(--font-display);
        font-size: 10px;
        font-weight: 600;
        letter-spacing: 0.42em;
        text-transform: uppercase;
        color: var(--ink-faint);
        z-index: 90;
        pointer-events: none;
        padding-bottom: 40px;
    }
    .rail-left { left: 16px; }
    .rail-right { right: 16px; }
    .meta-strip-inner { padding: 0 64px; }
    .nav-inner { padding: 0 64px; }
    .hero { padding-left: 64px; padding-right: 64px; }
    .section { padding-left: 64px; padding-right: 64px; }
    .sec-rule { padding-left: 64px; padding-right: 64px; }
    .footer { padding-left: 64px; padding-right: 64px; }
}