/* ═══════════════════════════════════════════════════════
   Paint Toys — app.css
   Design: warm off-white, ink-dark text, colourful tool cards
   Font: Nunito (display) + Space Grotesk (UI)
   ═══════════════════════════════════════════════════════ */

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

:root {
    --bg:         #f7f4ef;
    --surface:    #ffffff;
    --ink:        #1a1a1a;
    --ink-mid:    #555555;
    --ink-light:  #999999;
    --border:     #e2ddd8;
    --accent:     #ff6b6b;
    --accent-2:   #6bcbff;
    --radius:     14px;
    --radius-sm:  8px;
    --shadow:     0 4px 24px rgba(0,0,0,.08);
    --shadow-lg:  0 8px 40px rgba(0,0,0,.13);
    --font-display: 'Nunito', sans-serif;
    --font-body:    'Space Grotesk', sans-serif;
    --transition:   .2s ease;
    --sidebar-w:    280px;
    --header-h:     60px;
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { cursor: pointer; font-family: inherit; border: none; background: none; }

/* ── Header ────────────────────────────────────────────── */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: rgba(247,244,239,.92);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--border);
}
.site-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.site-header__logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.25rem;
    letter-spacing: -.02em;
}
.site-header__logo-icon { font-size: 1.5rem; }

.nav-link {
    font-weight: 600;
    font-size: .875rem;
    padding: 6px 14px;
    border-radius: 100px;
    transition: background var(--transition);
}
.nav-link:hover,
.nav-link--active { background: var(--ink); color: #fff; }

/* ── Hero ──────────────────────────────────────────────── */
.hero {
    padding: 72px 24px 48px;
    text-align: center;
}
.hero__inner { max-width: 640px; margin: 0 auto; }
.hero__title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2.5rem, 6vw, 4rem);
    letter-spacing: -.03em;
    line-height: 1.1;
    margin-bottom: 16px;
}
.hero__title-accent {
    background: linear-gradient(135deg, var(--accent) 0%, #ff9f43 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.hero__subtitle {
    font-size: 1.125rem;
    color: var(--ink-mid);
    max-width: 480px;
    margin: 0 auto;
}

/* ── Tools grid ────────────────────────────────────────── */
.tools-grid { padding: 0 24px 64px; }
.tools-grid__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}

.tool-card {
    background: var(--surface);
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
    cursor: pointer;
}
.tool-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--card-color, var(--accent));
}

.tool-card__thumb {
    position: relative;
    aspect-ratio: 16/10;
    background: color-mix(in srgb, var(--card-color, #ff6b6b) 12%, var(--bg));
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tool-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .4s ease;
}
.tool-card:hover .tool-card__thumb img { transform: scale(1.05); }
.tool-card__emoji {
    position: absolute;
    font-size: 3rem;
    opacity: .35;
    pointer-events: none;
}
.tool-card__body { padding: 16px 18px 8px; flex: 1; }
.tool-card__name {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.05rem;
    margin-bottom: 6px;
}
.tool-card__desc {
    font-size: .84rem;
    color: var(--ink-mid);
    line-height: 1.5;
}
.tool-card__cta {
    display: block;
    padding: 10px 18px 14px;
    font-size: .8rem;
    font-weight: 700;
    color: var(--card-color, var(--accent));
    letter-spacing: .02em;
    text-transform: uppercase;
}

/* ── Canvas page layout ─────────────────────────────────── */
.canvas-page {
    display: flex;
    height: calc(100dvh - var(--header-h));
    overflow: hidden;
}

/* Sidebar */
.canvas-sidebar {
    width: var(--sidebar-w);
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
    padding: 20px 16px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    overflow-y: auto;
}
.canvas-sidebar__emoji { font-size: 2rem; display: block; margin-bottom: 4px; }
.canvas-sidebar__title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: 1.2rem;
    margin-bottom: 6px;
}
.canvas-sidebar__desc { font-size: .82rem; color: var(--ink-mid); line-height: 1.55; }

.canvas-sidebar__other-label {
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: var(--ink-light);
    margin-bottom: 8px;
}
.canvas-sidebar__list { list-style: none; display: flex; flex-direction: column; gap: 4px; }
.canvas-sidebar__link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px;
    border-radius: var(--radius-sm);
    font-size: .85rem;
    font-weight: 600;
    transition: background var(--transition), color var(--transition);
}
.canvas-sidebar__link:hover {
    background: color-mix(in srgb, var(--link-color, var(--accent)) 12%, transparent);
    color: var(--link-color, var(--accent));
}

/* Canvas wrap */
.canvas-wrap {
    flex: 1;
    position: relative;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
}
#main-canvas {
    flex: 1;
    width: 100%;
    height: 100%;
    display: block;
    cursor: crosshair;
    touch-action: none;
}

/* Controls */
.canvas-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(247,244,239,.96);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(8px);
}
.ctrl-btn {
    width: 38px; height: 38px;
    border-radius: var(--radius-sm);
    font-size: 1.1rem;
    display: flex; align-items: center; justify-content: center;
    border: 1.5px solid var(--border);
    background: var(--surface);
    transition: background var(--transition), transform var(--transition);
}
.ctrl-btn:hover { background: var(--ink); filter: invert(1); transform: scale(1.07); }
.ctrl-color {
    display: flex; align-items: center; gap: 4px;
    cursor: pointer;
    font-size: 1.1rem;
}
.ctrl-color input[type="color"] {
    width: 32px; height: 32px;
    border: none; border-radius: var(--radius-sm);
    cursor: pointer; padding: 0;
    background: none;
}
.ctrl-range input[type="range"] { width: 100px; accent-color: var(--accent); }

/* Below-canvas ad */
.below-canvas-ad { padding: 12px 24px; }

/* ── AdSense units ─────────────────────────────────────── */
.ad-unit { overflow: hidden; }
.ad-unit--sidebar { min-height: 100px; }
.ad-unit--bottom  { min-height: 90px; }

/* ── SEO text block ─────────────────────────────────────── */
.seo-block {
    padding: 48px 24px;
    background: var(--surface);
    border-top: 1px solid var(--border);
}
.seo-block__inner { max-width: 800px; margin: 0 auto; }
.seo-block h2 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.4rem;
    margin-bottom: 12px;
}
.seo-block p { color: var(--ink-mid); font-size: .95rem; line-height: 1.7; max-width: 680px; }
.seo-block--tool { padding-top: 24px; }

/* ── 404 ───────────────────────────────────────────────── */
.error-page { display: flex; align-items: center; justify-content: center; min-height: 60vh; padding: 40px; }
.error-page__inner { text-align: center; }
.error-page__code { font-family: var(--font-display); font-size: 8rem; font-weight: 900; opacity: .08; display: block; line-height: 1; }
.error-page__title { font-family: var(--font-display); font-size: 2rem; font-weight: 800; margin-bottom: 12px; }
.error-page__text { color: var(--ink-mid); margin-bottom: 24px; }

/* ── Buttons ───────────────────────────────────────────── */
.btn {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 20px; border-radius: 100px;
    font-weight: 700; font-size: .9rem;
    transition: transform var(--transition), box-shadow var(--transition);
}
.btn--primary { background: var(--ink); color: #fff; }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.18); }

/* ── Footer ────────────────────────────────────────────── */
.site-footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    background: var(--bg);
}
.site-footer__inner {
    max-width: 1200px; margin: 0 auto;
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
}
.site-footer__copy { font-size: .82rem; color: var(--ink-light); }
.site-footer__links { display: flex; gap: 20px; }
.site-footer__links a { font-size: .82rem; color: var(--ink-light); transition: color var(--transition); }
.site-footer__links a:hover { color: var(--ink); }

/* ── Responsive ────────────────────────────────────────── */
@media (max-width: 768px) {
    .canvas-page { flex-direction: column; height: auto; }
    .canvas-sidebar { width: 100%; border-right: none; border-bottom: 1px solid var(--border); flex-direction: column; }
    .canvas-sidebar__other { display: none; }  /* hide on small screens */
    .canvas-wrap { height: 65vmin; min-height: 320px; }
    .hero { padding: 40px 20px 32px; }
    .tools-grid__inner { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; }
    .ctrl-range input[type="range"] { width: 70px; }
}

/* ── Reduced motion ─────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── Legal pages (Terms / Privacy) ─────────────────────── */
.legal-page {
    padding: 48px 24px 80px;
}
.legal-page__inner {
    max-width: 760px;
    margin: 0 auto;
}
.legal-page__header {
    margin-bottom: 48px;
    padding-bottom: 32px;
    border-bottom: 2px solid var(--border);
}
.legal-page__label {
    font-size: .75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--ink-light);
    margin-bottom: 10px;
}
.legal-page__title {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(2rem, 5vw, 3rem);
    letter-spacing: -.03em;
    line-height: 1.1;
    margin-bottom: 12px;
}
.legal-page__meta {
    font-size: .85rem;
    color: var(--ink-light);
}

.legal-page__body {
    display: flex;
    flex-direction: column;
    gap: 28px;
}
.legal-page__body h2 {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.15rem;
    margin-bottom: 8px;
    color: var(--ink);
}
.legal-page__body p {
    font-size: .95rem;
    color: var(--ink-mid);
    line-height: 1.75;
}
.legal-page__body ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding-left: 0;
}
.legal-page__body ul li {
    font-size: .95rem;
    color: var(--ink-mid);
    line-height: 1.65;
    padding-left: 20px;
    position: relative;
}
.legal-page__body ul li::before {
    content: '–';
    position: absolute;
    left: 0;
    color: var(--ink-light);
}
.legal-page__body a {
    color: var(--ink);
    text-decoration: underline;
    text-underline-offset: 3px;
    transition: color var(--transition);
}
.legal-page__body a:hover { color: var(--accent); }

.legal-page__footer {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 56px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.btn--ghost {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--border);
}
.btn--ghost:hover {
    border-color: var(--ink);
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(0,0,0,.08);
}

/* ── Contact page ───────────────────────────────────────── */
.contact-form { display: flex; flex-direction: column; gap: 20px; margin-bottom: 48px; }
.contact-form__row { display: grid; gap: 20px; }
.contact-form__row--2col { grid-template-columns: 1fr 1fr; }
.contact-form__field { display: flex; flex-direction: column; gap: 6px; }
.contact-form__label { font-size: .85rem; font-weight: 600; color: var(--ink); }
.contact-form__label span { color: var(--accent); }

.contact-form__input {
    width: 100%;
    padding: 10px 14px;
    font-family: var(--font-body);
    font-size: .95rem;
    color: var(--ink);
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color var(--transition);
    appearance: none;
}
.contact-form__input:focus { border-color: var(--ink); }
.contact-form__textarea { resize: vertical; min-height: 140px; line-height: 1.6; }
.contact-form__select { cursor: pointer; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' fill='none' stroke='%23999' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 14px center; padding-right: 36px; }

.contact-form__footer { display: flex; flex-direction: column; gap: 10px; }
.contact-form__submit { align-self: flex-start; padding: 12px 28px; font-size: 1rem; }
.contact-form__note { font-size: .8rem; color: var(--ink-light); }
.contact-form__note a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }

.contact-success {
    display: flex; align-items: flex-start; gap: 16px;
    padding: 20px 24px;
    background: #f0faf5;
    border: 1.5px solid #0be881;
    border-radius: var(--radius);
    margin-bottom: 32px;
}
.contact-success__icon {
    font-size: 1.4rem; line-height: 1;
    color: #05c46b;
    flex-shrink: 0;
}
.contact-success strong { display: block; margin-bottom: 4px; }
.contact-success p { font-size: .9rem; color: var(--ink-mid); margin: 0; }

.contact-error {
    padding: 14px 18px;
    background: #fff0f0;
    border: 1.5px solid #ff6b6b;
    border-radius: var(--radius-sm);
    color: #c0392b;
    font-size: .9rem;
    margin-bottom: 8px;
}

.contact-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-top: 48px;
    padding-top: 40px;
    border-top: 1px solid var(--border);
}
.contact-card {
    padding: 20px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
}
.contact-card__icon { font-size: 1.5rem; display: block; margin-bottom: 8px; }
.contact-card strong { display: block; font-family: var(--font-display); font-weight: 800; font-size: .95rem; margin-bottom: 6px; }
.contact-card p { font-size: .82rem; color: var(--ink-mid); line-height: 1.55; margin: 0; }

/* Rich SEO block on tool pages */
.seo-block--tool h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    margin: 24px 0 8px;
    color: var(--ink);
}

@media (max-width: 600px) {
    .contact-form__row--2col { grid-template-columns: 1fr; }
}

/* ── Disclaimer / DMCA page extras ─────────────────────── */
.legal-divider {
    border: none;
    border-top: 2px dashed var(--border);
    margin: 40px 0 8px;
}
.legal-contact-block {
    margin: 16px 0;
    padding: 18px 22px;
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    line-height: 2;
    color: var(--ink-mid);
}
.legal-contact-block strong { color: var(--ink); }
.legal-contact-block a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
