/* ============================================================
   shtmls — Refined dark editorial aesthetic
   Typography: DM Sans + JetBrains Mono
   Palette: obsidian bg, warm copper accent, cool zinc neutrals
   ============================================================ */

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

:root {
    --bg:             #08080a;
    --surface:        #111114;
    --surface-hover:  #19191e;
    --border:         #1f1f26;
    --border-hover:   #2c2c36;
    --text:           #ececef;
    --text-secondary: #8b8b96;
    --text-muted:     #55555f;
    --accent:         #d4956a;
    --accent-hover:   #e0a67b;
    --accent-dim:     rgba(212, 149, 106, 0.12);
    --accent-glow:    rgba(212, 149, 106, 0.06);
    --success:        #5cb87a;
    --error:          #d45a5a;
    --error-bg:       rgba(212, 90, 90, 0.08);
    --radius:         12px;
    --radius-sm:      8px;
    --radius-xs:      6px;
    --transition:     180ms ease;
    --font-body:      'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono:      'JetBrains Mono', 'Fira Code', 'SF Mono', monospace;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
}

/* ---- Ambient background effects ---- */

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

.glow {
    position: fixed;
    border-radius: 50%;
    filter: blur(120px);
    pointer-events: none;
    z-index: 0;
}

.glow-1 {
    width: 600px;
    height: 600px;
    top: -200px;
    right: -150px;
    background: radial-gradient(circle, rgba(212, 149, 106, 0.06) 0%, transparent 70%);
}

.glow-2 {
    width: 500px;
    height: 500px;
    bottom: -100px;
    left: -200px;
    background: radial-gradient(circle, rgba(120, 100, 180, 0.04) 0%, transparent 70%);
}

/* ---- Layout ---- */

.container {
    position: relative;
    z-index: 1;
    max-width: 560px;
    margin: 0 auto;
    padding: 80px 24px 48px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ---- Header ---- */

.header {
    text-align: center;
    margin-bottom: 48px;
    animation: fadeUp 600ms ease both;
}

.logo {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 2rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
    letter-spacing: -0.02em;
    transition: color var(--transition);
}

.logo:hover {
    color: var(--accent);
}

.logo-bracket {
    color: var(--accent);
    font-weight: 400;
}

.logo-h { color: #e06c75; }
.logo-t { color: #61afef; }
.logo-m { color: #98c379; }
.logo-l { color: #e5c07b; }

.headline {
    margin-top: 16px;
    font-size: 1.5rem;
    font-weight: 500;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.3;
    text-wrap: balance;
}

.tagline {
    margin-top: 12px;
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.7;
    font-weight: 300;
}

/* ---- Workflow Steps Strip ---- */

.steps-strip {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    padding: 20px 16px;
    margin-bottom: 24px;
    animation: fadeUp 600ms ease both;
    animation-delay: 50ms;
}

.step {
    display: flex;
    align-items: center;
    gap: 10px;
    opacity: 0.35;
    transition: opacity var(--transition);
}

.step.active {
    opacity: 1;
}

.step.completed {
    opacity: 0.6;
}

.step-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--border-hover);
    color: var(--text-muted);
    flex-shrink: 0;
    transition: all var(--transition);
}

.step.active .step-icon {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--accent-glow);
}

.step.completed .step-icon {
    border-color: var(--success);
    color: var(--success);
    background: rgba(92, 184, 122, 0.08);
}

.step-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.step-label {
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition);
}

.step.active .step-label {
    color: var(--text);
}

.step-sub {
    font-size: 0.7rem;
    color: var(--text-muted);
}

.step-connector {
    width: 24px;
    height: 1px;
    background: var(--border);
    margin: 0 8px;
    flex-shrink: 0;
}

/* ---- Cards ---- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 32px;
    animation: fadeUp 600ms ease both;
    animation-delay: 100ms;
}

.card + .card {
    margin-top: 16px;
}

/* ---- Dropzone ---- */

.dropzone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 48px 24px;
    border: 1.5px dashed var(--border-hover);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    margin-bottom: 24px;
    background: transparent;
}

.dropzone:hover,
.dropzone:focus-visible {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.dropzone.dragover {
    border-color: var(--accent);
    background: var(--accent-dim);
    transform: scale(1.01);
}

.dropzone-icon {
    color: var(--text-muted);
    margin-bottom: 16px;
    transition: color var(--transition);
}

.dropzone:hover .dropzone-icon,
.dropzone.dragover .dropzone-icon {
    color: var(--accent);
}

.dropzone-text {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

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

/* ---- File info bar ---- */

.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: var(--accent-dim);
    border: 1px solid rgba(212, 149, 106, 0.15);
    border-radius: var(--radius-sm);
    margin-bottom: 24px;
    animation: fadeUp 200ms ease both;
}

.file-info-left {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.file-icon {
    color: var(--accent);
    flex-shrink: 0;
}

.file-name {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
}

.remove-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: all var(--transition);
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.remove-btn:hover {
    color: var(--error);
    background: var(--error-bg);
}

/* ---- File preview ---- */

.preview-container {
    margin-bottom: 24px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    overflow: hidden;
    animation: fadeUp 200ms ease both;
}

.preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
}

.preview-label {
    font-size: 0.72rem;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.preview-frame {
    width: 100%;
    height: 200px;
    border: none;
    background: #fff;
}

/* ---- Form elements ---- */

.form-group {
    margin-bottom: 20px;
}

.label {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input {
    width: 100%;
    padding: 12px 16px;
    padding-right: 48px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all var(--transition);
}

.input::placeholder {
    color: var(--text-muted);
}

.input:hover {
    border-color: var(--border-hover);
}

.input:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

.input-action {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    transition: color var(--transition);
}

.input-action:hover {
    color: var(--text-secondary);
}

/* ---- Buttons ---- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 13px 24px;
    font-family: var(--font-body);
    font-size: 0.9rem;
    font-weight: 500;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all var(--transition);
    position: relative;
}

.btn:disabled {
    opacity: 0.35;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    color: #0a0a0a;
}

.btn-primary:hover:not(:disabled) {
    background: var(--accent-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 20px rgba(212, 149, 106, 0.2);
}

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

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    color: var(--text);
    border-color: var(--border-hover);
    background: var(--surface-hover);
}

.btn-copy {
    width: auto;
    padding: 8px 14px;
    font-size: 0.8rem;
    font-family: var(--font-mono);
    background: var(--surface-hover);
    color: var(--text-secondary);
    border: 1px solid var(--border);
    flex-shrink: 0;
}

.btn-copy:hover {
    color: var(--text);
    border-color: var(--border-hover);
}

.btn-copy.copied {
    color: var(--success);
    border-color: rgba(92, 184, 122, 0.3);
}

.btn-toolbar {
    width: auto;
    padding: 6px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid transparent;
}

.btn-toolbar:hover {
    color: var(--text);
    background: var(--surface-hover);
    border-color: var(--border);
}

.btn-arrow {
    transition: transform var(--transition);
}

.btn:hover:not(:disabled) .btn-arrow {
    transform: translateX(2px);
}

/* ---- Spinner ---- */

.spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(10, 10, 10, 0.2);
    border-top-color: #0a0a0a;
    border-radius: 50%;
    animation: spin 600ms linear infinite;
}

.btn.loading .btn-text,
.btn.loading .btn-arrow {
    visibility: hidden;
}

.btn.loading .spinner {
    position: absolute;
}

/* ---- Result card ---- */

.result-card {
    animation-delay: 0ms;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.result-check {
    color: var(--success);
    flex-shrink: 0;
}

.result-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
}

.url-display {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 12px;
}

.url-text {
    font-family: var(--font-mono);
    font-size: 0.85rem;
    color: var(--accent);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.expires-text {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

/* ---- Unlock / Viewer ---- */

.unlock-card {
    text-align: center;
    padding: 48px 32px 36px;
}

.lock-visual {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    margin-bottom: 24px;
}

.lock-ring {
    position: absolute;
    inset: 0;
    border: 1.5px solid var(--border-hover);
    border-radius: 50%;
    animation: pulse-ring 3s ease-in-out infinite;
}

.lock-icon {
    color: var(--accent);
}

.unlock-title {
    font-size: 1.2rem;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.unlock-subtitle {
    font-size: 0.88rem;
    color: var(--text-secondary);
    margin-bottom: 28px;
}

.unlock-card .form-group {
    text-align: left;
}

.page-meta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    font-size: 0.78rem;
    color: var(--text-muted);
    animation: fadeUp 400ms ease both;
    animation-delay: 200ms;
}

.meta-sep {
    opacity: 0.4;
}

/* ---- Error text ---- */

.error-text {
    margin-top: 12px;
    padding: 10px 14px;
    font-size: 0.82rem;
    color: var(--error);
    background: var(--error-bg);
    border-radius: var(--radius-xs);
    animation: shake 400ms ease;
}

/* ---- Content viewer ---- */

.content-view {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    flex-direction: column;
    background: var(--bg);
    animation: fadeIn 300ms ease both;
}

.content-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 20px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.toolbar-logo {
    font-family: var(--font-mono);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text);
    text-decoration: none;
}

.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.toolbar-filename {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    color: var(--text-muted);
}

.content-frame {
    flex: 1;
    width: 100%;
    border: none;
    background: #fff;
}

/* ---- Stats bar ---- */

.stats-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 16px 0;
    margin-top: 24px;
    animation: fadeUp 600ms ease both;
    animation-delay: 400ms;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.stat-value {
    font-family: var(--font-mono);
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--text);
    font-variant-numeric: tabular-nums;
}

.stat-label {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
}

/* ---- LLM Tip ---- */

.llm-tip {
    text-align: center;
    padding: 32px 24px;
    margin-top: 32px;
    border-top: 1px solid var(--border);
    animation: fadeUp 600ms ease both;
    animation-delay: 500ms;
}

.llm-tip-title {
    font-size: 1rem;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 10px;
    letter-spacing: -0.01em;
}

.llm-tip-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 16px;
}

.llm-tip-link {
    color: var(--accent);
    text-decoration: none;
    font-family: var(--font-mono);
    font-size: 0.82rem;
}

.llm-tip-link:hover {
    color: var(--accent-hover);
    text-decoration: underline;
}

.llm-tip-prompt {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px 10px 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin-bottom: 16px;
}

.llm-tip-prompt code {
    font-family: var(--font-mono);
    font-size: 0.82rem;
    color: var(--text);
}

.btn-copy-prompt {
    width: auto;
    padding: 6px;
    font-size: 0;
    flex-shrink: 0;
}

.llm-tip-note {
    font-size: 0.78rem;
    color: var(--text-muted);
}

/* ---- Footer ---- */

.footer {
    margin-top: auto;
    padding-top: 48px;
    text-align: center;
    animation: fadeUp 600ms ease both;
    animation-delay: 300ms;
}

.trust-signals {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 8px;
    font-size: 0.78rem;
    color: var(--text-muted);
}

.trust-item {
    white-space: nowrap;
}

.trust-sep {
    opacity: 0.4;
}

/* ---- Utilities ---- */

.hidden {
    display: none !important;
}

/* ---- Animations ---- */

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse-ring {
    0%, 100% {
        transform: scale(1);
        opacity: 0.5;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.2;
    }
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-6px); }
    30% { transform: translateX(5px); }
    45% { transform: translateX(-4px); }
    60% { transform: translateX(3px); }
    75% { transform: translateX(-1px); }
}

/* ---- Focus visible for buttons ---- */

.btn:focus-visible,
.remove-btn:focus-visible,
.input-action:focus-visible,
.dropzone:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* ---- Touch optimization ---- */

button, a, .dropzone {
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(212, 149, 106, 0.1);
}

/* ---- Reduced motion ---- */

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

    .lock-ring {
        animation: none;
    }
}

/* ---- Responsive ---- */

@media (max-width: 600px) {
    .container {
        padding: 48px 16px 32px;
    }

    .card {
        padding: 24px 20px;
    }

    .dropzone {
        padding: 36px 16px;
    }

    .logo {
        font-size: 1.6rem;
    }

    .headline {
        font-size: 1.25rem;
    }

    .steps-strip {
        gap: 0;
        padding: 16px 0;
    }

    .step-text {
        display: none;
    }

    .step-connector {
        width: 32px;
    }

    .unlock-card {
        padding: 36px 20px 28px;
    }

    .url-display {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }

    .btn-copy {
        width: 100%;
    }
}
