/* ============================================================
   Zerotop Deepmind — main stylesheet
   Colors & fonts come from CSS vars set in inc/dynamic-css.php
   ============================================================ */

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

html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: var(--zd-bg);
    color: var(--zd-text);
    font-family: var(--zd-font-body);
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg, video { max-width: 100%; height: auto; display: block; }

a {
    color: var(--zd-primary);
    text-decoration: none;
    transition: color .2s ease;
}
a:hover, a:focus { color: var(--zd-accent); }

h1, h2, h3, h4 {
    font-family: var(--zd-font-display);
    font-weight: 500;
    color: var(--zd-text);
    letter-spacing: -0.01em;
    line-height: 1.15;
    margin: 0 0 .6em;
}

p { margin: 0 0 1em; }

button { font: inherit; }

::selection { background: var(--zd-accent); color: #fff; }

/* ---------- Layout ---------- */
.container {
    width: 100%;
    max-width: 1180px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
}
.container--narrow { max-width: 760px; }

.section { padding: 96px 0; position: relative; }
.section--centered { padding: 120px 0; text-align: center; }
.text-center { text-align: center; }

@media (max-width: 700px) {
    .section { padding: 64px 0; }
}

/* ---------- Accessibility ---------- */
.screen-reader-text {
    position: absolute !important;
    clip-path: inset(50%);
    width: 1px; height: 1px; overflow: hidden;
    word-wrap: normal !important;
}
.skip-link {
    position: absolute;
    left: -9999px;
    top: 1rem;
    background: var(--zd-text);
    color: #fff;
    padding: .6rem 1rem;
    border-radius: 4px;
    z-index: 100;
}
.skip-link:focus { left: 1rem; }

/* ---------- Header ---------- */
.site-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: color-mix(in srgb, var(--zd-bg) 92%, transparent);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid color-mix(in srgb, var(--zd-border) 60%, transparent);
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 18px;
    padding-bottom: 18px;
    gap: 24px;
}
.site-branding .site-title {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--zd-font-display);
    font-size: 1.4rem;
    color: var(--zd-text);
    text-decoration: none;
}
.site-title__mark {
    color: var(--zd-accent);
    display: inline-flex;
}
.custom-logo { max-height: 48px; width: auto; }

.site-nav .primary-menu {
    list-style: none;
    margin: 0; padding: 0;
    display: flex;
    align-items: center;
    gap: 28px;
}
.site-nav a {
    color: var(--zd-text);
    text-decoration: none;
    font-size: .98rem;
    font-weight: 500;
    padding: 6px 0;
    position: relative;
}
.site-nav a::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: 0;
    height: 1px;
    background: var(--zd-accent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s ease;
}
.site-nav a:hover::after,
.site-nav .current-menu-item > a::after { transform: scaleX(1); }

/* Mobile nav */
.nav-toggle {
    display: none;
    width: 44px; height: 44px;
    background: transparent;
    border: 1px solid var(--zd-border);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
}
.nav-toggle__bar {
    display: block;
    width: 20px; height: 1.5px;
    background: var(--zd-text);
    margin: 4px auto;
    transition: transform .2s ease, opacity .2s ease;
}
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(1) { transform: translateY(5.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bar:nth-child(3) { transform: translateY(-5.5px) rotate(-45deg); }

@media (max-width: 860px) {
    .nav-toggle { display: block; }
    .site-nav {
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--zd-bg);
        border-bottom: 1px solid var(--zd-border);
        padding: 24px;
        max-height: 0;
        overflow: hidden;
        transition: max-height .3s ease;
    }
    .site-nav.is-open { max-height: 70vh; }
    .site-nav .primary-menu { flex-direction: column; align-items: flex-start; gap: 18px; }
}

/* ---------- Hero ---------- */
.hero {
    position: relative;
    padding: 120px 0 96px;
    overflow: hidden;
}
.hero__decor {
    position: absolute;
    left: 0; right: 0;
    color: var(--zd-accent);
    pointer-events: none;
}
.hero__decor--top { bottom: -1px; }
.hero__decor svg { width: 100%; height: 200px; display: block; }

.hero__inner {
    display: grid;
    grid-template-columns: 1.05fr .95fr;
    align-items: center;
    gap: 64px;
    position: relative;
}
.hero__copy { max-width: 560px; }
.hero__title {
    font-size: clamp(2.4rem, 5vw, 3.8rem);
    line-height: 1.05;
    margin-bottom: .5em;
}
.hero__subtitle {
    font-size: 1.15rem;
    color: var(--zd-muted);
    max-width: 50ch;
    margin-bottom: 2rem;
}
.hero__cta { margin: 0; }
.hero__visual {
    position: relative;
    aspect-ratio: 1 / 1;
    max-width: 480px;
    margin-left: auto;
}
.hero__image {
    width: 100%; height: 100%;
    object-fit: cover;
    border-radius: 50%;
    box-shadow: 0 20px 60px -20px rgba(0,0,0,.18);
}
.hero__placeholder {
    color: var(--zd-accent);
    width: 100%; height: 100%;
}
.hero__placeholder svg { width: 100%; height: 100%; }

@media (max-width: 860px) {
    .hero { padding: 64px 0; }
    .hero__inner { grid-template-columns: 1fr; gap: 40px; }
    .hero__visual { max-width: 320px; margin: 0 auto; }
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: 14px 28px;
    border-radius: 999px;
    font-family: var(--zd-font-body);
    font-weight: 500;
    font-size: .98rem;
    line-height: 1;
    border: 1px solid transparent;
    cursor: pointer;
    transition: transform .15s ease, background .2s ease, color .2s ease, border-color .2s ease, box-shadow .2s ease;
    text-decoration: none;
}
.btn--small { padding: 10px 18px; font-size: .9rem; }
.btn--primary {
    background: var(--zd-primary);
    color: #fff;
    box-shadow: 0 8px 24px -10px color-mix(in srgb, var(--zd-primary) 70%, transparent);
}
.btn--primary:hover, .btn--primary:focus {
    background: var(--zd-accent);
    color: #fff;
    transform: translateY(-1px);
}
.btn--ghost {
    background: transparent;
    color: var(--zd-primary);
    border-color: var(--zd-primary);
}
.btn--ghost:hover, .btn--ghost:focus {
    background: var(--zd-primary);
    color: #fff;
}

/* ---------- Section header ---------- */
.section-header {
    max-width: 720px;
    margin: 0 auto 56px;
    text-align: center;
}
.section-header .section-title { font-size: clamp(2rem, 3.6vw, 2.8rem); }
.section-intro {
    color: var(--zd-muted);
    font-size: 1.1rem;
}
.eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: .14em;
    font-size: .78rem;
    font-weight: 600;
    color: var(--zd-accent);
    margin-bottom: 14px;
}

/* ---------- About ---------- */
.section--about { background: var(--zd-surface); }
.about {
    display: grid;
    grid-template-columns: .95fr 1.05fr;
    gap: 72px;
    align-items: center;
}
.about__visual { position: relative; }
.about__image {
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 30px 60px -30px rgba(0,0,0,.25);
}
.about__placeholder {
    color: var(--zd-primary);
    aspect-ratio: 4 / 5;
    border-radius: 8px;
    overflow: hidden;
    background: color-mix(in srgb, var(--zd-bg) 70%, var(--zd-surface));
}
.about__placeholder svg { width: 100%; height: 100%; }
.about__decor {
    position: absolute;
    bottom: -28px; right: -28px;
    width: 100px;
    color: var(--zd-accent);
    opacity: .55;
}
.about__quote {
    border-left: 3px solid var(--zd-accent);
    padding: 4px 0 4px 20px;
    margin: 0 0 24px;
    font-family: var(--zd-font-display);
    font-style: italic;
    font-size: 1.25rem;
    color: var(--zd-primary);
}
.about__quote p { margin: 0; }

.check-list {
    list-style: none;
    padding: 0;
    margin: 24px 0 32px;
    display: grid;
    gap: 12px;
}
.check-list li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.check-list__icon {
    color: var(--zd-sage);
    flex-shrink: 0;
    margin-top: 4px;
}

@media (max-width: 860px) {
    .about { grid-template-columns: 1fr; gap: 40px; }
    .about__decor { display: none; }
}

/* ---------- Services ---------- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
}
.service-card {
    background: var(--zd-surface);
    border: 1px solid var(--zd-border);
    border-radius: 12px;
    padding: 36px 28px;
    transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
    display: flex;
    flex-direction: column;
}
.service-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 48px -24px rgba(0,0,0,.18);
    border-color: color-mix(in srgb, var(--zd-accent) 40%, var(--zd-border));
}
.service-card__icon {
    width: 56px; height: 56px;
    color: var(--zd-accent);
    margin-bottom: 20px;
    display: flex; align-items: center; justify-content: center;
}
.service-card__icon img,
.service-card__icon svg { width: 100%; height: 100%; object-fit: contain; }
.service-card__title { font-size: 1.35rem; margin-bottom: .4em; }
.service-card__desc {
    color: var(--zd-muted);
    margin-bottom: 18px;
    flex-grow: 1;
}
.service-card__link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-weight: 500;
    color: var(--zd-primary);
    text-decoration: none;
}
.service-card__link span { transition: transform .2s ease; }
.service-card__link:hover span { transform: translateX(4px); }

/* ---------- Banner ---------- */
.section--banner {
    padding: 80px 0;
    background: color-mix(in srgb, var(--zd-primary) 92%, #000);
    color: #fff;
    text-align: center;
}
.section--banner .container { position: relative; }
.banner__mark {
    display: inline-flex;
    color: var(--zd-accent);
    margin-bottom: 16px;
    width: 40px; height: 40px;
}
.banner__quote {
    font-family: var(--zd-font-display);
    font-style: italic;
    font-size: clamp(1.4rem, 2.4vw, 2rem);
    line-height: 1.4;
    color: #fff;
    margin: 0;
}

/* ---------- Testimonials ---------- */
.section--testimonials { background: var(--zd-surface); }
.testimonial-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 28px;
}
.testimonial {
    background: var(--zd-bg);
    border-radius: 12px;
    padding: 32px 28px;
    border: 1px solid var(--zd-border);
    margin: 0;
}
.testimonial__stars {
    color: var(--zd-accent);
    display: flex;
    gap: 2px;
    margin-bottom: 16px;
}
.testimonial__text {
    margin: 0 0 16px;
    font-family: var(--zd-font-display);
    font-size: 1.1rem;
    line-height: 1.5;
    color: var(--zd-text);
}
.testimonial__text p { margin: 0; }
.testimonial__name {
    font-size: .92rem;
    color: var(--zd-muted);
    font-weight: 500;
}

/* ---------- Footer ---------- */
.site-footer {
    background: var(--zd-text);
    color: color-mix(in srgb, #fff 80%, transparent);
    padding: 88px 0 32px;
    margin-top: 0;
}
.site-footer h2, .site-footer h3 { color: #fff; }
.site-footer a { color: #fff; }
.site-footer a:hover { color: var(--zd-accent); }
.site-footer__intro {
    text-align: center;
    max-width: 640px;
    margin: 0 auto 56px;
}
.site-footer__title { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.site-footer__lead { color: color-mix(in srgb, #fff 75%, transparent); font-size: 1.1rem; }
.site-footer__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    padding-bottom: 56px;
    border-bottom: 1px solid color-mix(in srgb, #fff 12%, transparent);
}
.site-footer__col h3 {
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: .12em;
    margin-bottom: 16px;
}
.contact-list, .social-list, .footer-menu {
    list-style: none;
    padding: 0; margin: 0;
    display: grid;
    gap: 8px;
}
.site-footer__bottom {
    padding-top: 24px;
    text-align: center;
    font-size: .9rem;
    color: color-mix(in srgb, #fff 60%, transparent);
}
.site-footer__bottom p { margin: 0; }

/* ---------- Generic content (page/post) ---------- */
.page-header { padding: 88px 0 32px; text-align: center; }
.page-title { font-size: clamp(2rem, 4vw, 3rem); }
.page-thumb { padding-bottom: 32px; }
.page-thumb img { border-radius: 10px; }

.entry-content > * + * { margin-top: 1em; }
.entry-content h2 { font-size: 1.8rem; margin-top: 1.6em; }
.entry-content h3 { font-size: 1.4rem; margin-top: 1.4em; }
.entry-content blockquote {
    border-left: 3px solid var(--zd-accent);
    padding: 8px 0 8px 24px;
    font-family: var(--zd-font-display);
    font-style: italic;
    font-size: 1.2rem;
    color: var(--zd-primary);
}
.entry-content img { border-radius: 6px; }
.entry-content a { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }

/* ---------- Posts grid ---------- */
.post-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 32px;
    margin-bottom: 48px;
}
.post-card {
    background: var(--zd-surface);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--zd-border);
    display: flex;
    flex-direction: column;
}
.post-card__thumb img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.post-card__body { padding: 24px; display: flex; flex-direction: column; gap: 12px; flex-grow: 1; }
.post-card__title { font-size: 1.4rem; margin: 0; }
.post-card__title a { color: var(--zd-text); }
.post-card__title a:hover { color: var(--zd-accent); }
.post-card__meta { font-size: .85rem; color: var(--zd-muted); }
.post-card__excerpt { color: var(--zd-muted); flex-grow: 1; }
.post-card__excerpt p { margin: 0; }

.pagination { display: flex; justify-content: center; }
.pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    margin: 0 2px;
    border-radius: 6px;
    color: var(--zd-text);
    text-decoration: none;
}
.pagination .page-numbers.current { background: var(--zd-primary); color: #fff; }
.pagination .page-numbers:hover { background: var(--zd-border); }

/* ---------- Search form ---------- */
.search-form {
    display: flex;
    gap: 8px;
    max-width: 480px;
    margin: 24px auto;
}
.search-field {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid var(--zd-border);
    border-radius: 999px;
    background: var(--zd-surface);
    color: var(--zd-text);
    font: inherit;
}
.search-field:focus { outline: 2px solid var(--zd-accent); outline-offset: 2px; }

/* ---------- Comments ---------- */
.comments-area {
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--zd-border);
}
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 32px; }
.comment-list li { margin-bottom: 24px; }

/* ---------- Reveal animation ---------- */
.reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible {
    opacity: 1;
    transform: translateY(0);
}
@media (prefers-reduced-motion: reduce) {
    .reveal { opacity: 1; transform: none; transition: none; }
    html { scroll-behavior: auto; }
}
