:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #f8fafc;
    --text-color: #0f172a;
    --text-muted: #64748b;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;
    --success-color: #22c55e;
    --gradient-start: #6366f1;
    --gradient-end: #a855f7;
    --radius: 12px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
}

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(99, 102, 241, 0.35);
    outline-offset: 3px;
}

img,
svg,
canvas {
    max-width: 100%;
}

img {
    height: auto;
}

svg {
    flex-shrink: 0;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Header & Brand */
header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1.5rem;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-weight: 800;
    letter-spacing: -0.025em;
    min-width: 0;
}

.brand-mark {
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    border-radius: var(--radius);
    color: white;
    background: linear-gradient(135deg, var(--gradient-start), var(--gradient-end));
    font-size: 0.75rem;
    font-weight: 900;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.2);
}

.brand-copy {
    display: flex;
    flex-direction: column;
    line-height: 1.1;
    min-width: 0;
}

.brand-copy strong {
    font-size: 1.25rem;
    background: linear-gradient(to right, var(--gradient-start), var(--gradient-end));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand-copy span {
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0;
    margin-top: 0.15rem;
    white-space: nowrap;
}

.company-link {
    color: inherit;
    font-weight: 750;
    text-decoration: underline;
    text-decoration-color: rgba(99, 102, 241, 0.35);
    text-underline-offset: 3px;
}

.company-link:hover {
    color: var(--primary-color);
    text-decoration-color: currentColor;
}

.company-link.subtle {
    font-weight: inherit;
    text-decoration-thickness: 1px;
}

.company-link.inline {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: clamp(0.75rem, 2vw, 2rem);
    font-weight: 500;
    font-size: 0.95rem;
    min-width: 0;
}

.nav-links a:hover {
    color: var(--primary-color);
}

/* Hero Section */
.hero {
    padding: 6rem 0 5rem;
    text-align: center;
    background:
        linear-gradient(125deg, rgba(255, 153, 51, 0.05), rgba(255, 255, 255, 0.9) 42%, rgba(19, 136, 8, 0.05)),
        radial-gradient(circle at 82% 12%, rgba(99, 102, 241, 0.08), transparent 34%),
        radial-gradient(circle at 10% 82%, rgba(168, 85, 247, 0.08), transparent 31%);
}

.hero h1 {
    font-size: 4rem;
    font-weight: 800;
    letter-spacing: -0.05em;
    line-height: 1;
    margin-bottom: 1.5rem;
    background: linear-gradient(to bottom right, #0f172a, #334155);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero p {
    font-size: 1.25rem;
    color: var(--text-muted);
    max-width: 700px;
    margin: 0 auto 2.5rem;
}

.cta-group {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.privacy-pill-row {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin: 0 0 2rem;
}

.privacy-pill-row.centered {
    justify-content: center;
}

.privacy-pill {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0.45rem 0.85rem;
    border: 1px solid rgba(34, 197, 94, 0.22);
    border-radius: 999px;
    color: #047857;
    background: #ecfdf5;
    font-size: 0.82rem;
    font-weight: 750;
    line-height: 1.15;
    white-space: nowrap;
}

.hero .privacy-pill-row {
    margin-top: -1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    border: 1px solid transparent;
    font-weight: 600;
    font-family: inherit;
    font-size: 0.95rem;
    line-height: 1.2;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
    text-align: center;
    white-space: nowrap;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.btn-outline {
    border: 1px solid var(--border-color);
    background-color: white;
}

.btn-outline:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: #f5f3ff;
}

/* Sections */
section {
    padding: 4rem 0;
}

.section-title {
    text-align: center;
    margin-bottom: 3rem;
}

.section-title h2 {
    font-size: 2.25rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-title p {
    color: var(--text-muted);
}

/* Grid Layouts */
.grid {
    display: grid;
    gap: 2rem;
}

.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
}

.grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 400px), 1fr));
}

/* Cards */
.card {
    background: var(--card-bg);
    padding: 2.5rem 2rem;
    border-radius: 1.5rem;
    border: 1px solid var(--border-color);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    min-width: 0;
}

.card:hover {
    border-color: var(--primary-color);
    transform: translateY(-4px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.card-icon {
    width: 3rem;
    height: 3rem;
    background: #f5f3ff;
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    font-size: 1.5rem;
    line-height: 1;
    overflow: hidden;
    flex-shrink: 0;
}

.card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.card p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 1.5rem;
}

/* Privacy Section */
.privacy-feature {
    background: linear-gradient(to right, #f8fafc, #f1f5f9);
    padding: 4rem 2rem;
    border-radius: 2rem;
    text-align: center;
}

.privacy-feature h2 {
    margin-bottom: 1.5rem;
}

.privacy-feature p {
    max-width: 700px;
    margin: 0 auto;
    font-size: 1.1rem;
    color: var(--text-muted);
}

.privacy-feature .privacy-pill-row {
    margin-bottom: 1.5rem;
}

.preset-intro {
    color: var(--text-muted);
}

.preset-intro:empty {
    display: none;
}

.seo-content {
    display: grid;
    gap: 1rem;
    margin-top: 3rem;
}

.content-block {
    padding: 2rem;
}

.content-block h2 {
    margin-bottom: 0.85rem;
}

.content-block h3 {
    margin-top: 1.5rem;
    margin-bottom: 0.4rem;
}

.content-block h3:first-of-type {
    margin-top: 0;
}

.content-block p,
.content-block li {
    color: var(--text-muted);
}

.content-block ul {
    padding-left: 1.25rem;
}

.content-block li {
    margin-bottom: 0.5rem;
}

.content-block a {
    color: var(--primary-color);
    font-weight: 700;
}

.faq-section p {
    margin-bottom: 0.5rem;
}

.privacy-page {
    max-width: 900px;
    display: grid;
    gap: 1rem;
}

.privacy-page-section {
    padding-top: 2.5rem;
}

.privacy-policy-card {
    padding: 2rem;
}

.privacy-policy-card h3 {
    margin-bottom: 0.75rem;
}

.privacy-policy-card h2 {
    font-size: 1.25rem;
    margin-bottom: 0.75rem;
}

.privacy-policy-card p {
    color: var(--text-muted);
}

/* Trust Section */
.trust-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.trust-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 500;
}

.trust-item svg {
    color: var(--success-color);
}

/* Footer */
footer {
    background-color: #0f172a;
    color: #f8fafc;
    padding: 4rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 3rem;
}

.footer-privacy {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 2rem;
}

.footer-privacy .privacy-pill {
    border-color: rgba(148, 163, 184, 0.18);
    color: #d1fae5;
    background: rgba(34, 197, 94, 0.1);
}

.footer-brand h2 {
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-links a {
    color: #94a3b8;
}

.footer-links a:hover {
    color: white;
}

.footer-disclaimer {
    border-top: 1px solid #1e293b;
    padding-top: 2rem;
    font-size: 0.85rem;
    color: #64748b;
    line-height: 1.6;
}

/* Shared tool polish */
.privacy-badge {
    max-width: 100%;
    line-height: 1.3;
}

.tool-section {
    padding-top: 2.5rem;
}

.upload-card,
#resizer-controls,
#compressor-controls,
#results-area,
.instructions {
    min-width: 0;
}

.file-drop-area {
    background: linear-gradient(180deg, #ffffff, #f8fafc);
}

.file-drop-area input[type="file"] {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.file-drop-area input[type="file"]:focus-visible + label {
    outline: 3px solid rgba(99, 102, 241, 0.35);
    outline-offset: 3px;
}

.file-drop-area .text-muted,
.text-muted {
    color: var(--text-muted);
    margin-top: 0.75rem;
}

.preset-group,
.crop-tools,
.action-group,
.kb-presets {
    min-width: 0;
}

.preset-btn {
    min-width: max-content;
}

.input-group {
    min-width: 0;
}

.field,
.custom-controls,
.presets,
.adjustments {
    min-width: 0;
}

.field input,
.field select,
.custom-select {
    width: 100%;
    min-width: 0;
    font-size: 1rem;
}

.checkbox-group {
    min-width: 0;
}

.info-row {
    gap: 1rem;
}

.info-row strong {
    text-align: right;
    word-break: break-word;
}

#preview-image,
#image-to-crop {
    display: block;
    width: auto;
    max-width: 100%;
    max-height: 520px;
    object-fit: contain;
    margin: 0 auto;
}

.cropper-container,
.cropper-wrap-box,
.cropper-canvas,
.cropper-drag-box,
.cropper-crop-box,
.cropper-modal {
    max-width: 100%;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }
    .hero {
        padding: 4rem 0 3rem;
    }
    .hero p {
        font-size: 1.08rem;
    }
    nav {
        align-items: flex-start;
    }
    .nav-links {
        display: none; /* Simplification for mobile */
    }
    .brand-mark {
        width: 38px;
        height: 38px;
    }
    .brand-copy strong {
        font-size: 1.12rem;
    }
    .cta-group,
    .privacy-pill-row,
    .preset-group,
    .crop-tools,
    .action-group {
        align-items: stretch;
    }
    .privacy-pill-row {
        justify-content: center;
    }
    .privacy-pill {
        justify-content: center;
        white-space: normal;
    }
    .cta-group .btn,
    .preset-group .btn,
    .action-group .btn,
    #resize-btn,
    #compress-btn,
    #download-btn {
        width: 100%;
    }
    .card {
        padding: 1.5rem;
        border-radius: 1rem;
    }
    .card:hover {
        transform: none;
    }
    .input-group {
        flex-direction: column !important;
        gap: 0.75rem;
    }
    .preset-group,
    .crop-tools,
    .action-group,
    .kb-presets {
        flex-wrap: wrap !important;
    }
    .info-row {
        align-items: flex-start;
        flex-wrap: wrap;
    }
    footer {
        margin-top: 2rem;
        padding-top: 3rem;
    }
    .footer-content {
        display: grid;
    }
}
