/*
Theme Name: AutomationHero
Theme URI: https://automationhero.ai
Description: AutomationHero's site theme. Ivory, monospace, square corners, hairline rules. Sections are native blocks styled by the ah-* classes below.
Version: 1.0.5
Requires at least: 6.6
Requires PHP: 8.0
Text Domain: automationhero
*/

:root {
  --ah-surface: #f9f7f1; --ah-canvas: #eeeae0; --ah-ink: #1c1a16; --ah-ink-2: #615b50; --ah-ink-3: #8d8678;
  --ah-line: #ded8ca; --ah-fill: #e5e3dd; --ah-hover: #f0eee8; --ah-ink-hover: #36322b;
  --ah-dur: 160ms; --ah-ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}
html { scroll-padding-top: 80px; }
body { -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: var(--ah-ink); color: var(--ah-surface); }
:where(a, button, summary):focus-visible { outline: 2px solid var(--ah-ink); outline-offset: 2px; }
main { overflow-x: clip; }

/* ---- type helpers ---- */
.ah-cap { font-size: 12px !important; line-height: 16px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ah-ink-2); }
.ah-lead { font-size: 16px; line-height: 1.5; color: var(--ah-ink-2); max-width: 56ch; }
.ah-title { font-size: clamp(24px, 3vw, 32px) !important; line-height: 1.25 !important; letter-spacing: -0.02em !important; }
.ah-heading { font-size: 18px !important; line-height: 1.33; letter-spacing: 0.02em !important; text-transform: uppercase; }
.ah-big { font-size: clamp(32px, 4.6vw, 64px) !important; line-height: 1.04 !important; letter-spacing: -0.035em !important; text-wrap: balance; }
.ah-muted { color: var(--ah-ink-2); }
.ah-label { font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; }

/* ---- bands (full-width sections) ---- */
.ah-band { position: relative; isolation: isolate; border-top: 1px solid var(--ah-line); padding-block: 64px; }
@media (min-width: 720px) { .ah-band { padding-block: 96px; } }
.ah-band.is-canvas { background: var(--ah-canvas); }
.ah-band.is-tight { padding-block: 48px; }
.ah-band > * + * { margin-block-start: 48px; }
.ah-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px; }
.ah-head > * { margin: 0 !important; }
.ah-head-text { display: flex; flex-direction: column; gap: 16px; max-width: 56ch; }
.ah-head-text > * { margin: 0 !important; }

/* ---- buttons ---- */
.wp-block-button__link { transition: background-color var(--ah-dur) var(--ah-ease), color var(--ah-dur) var(--ah-ease); }
.wp-block-button__link:hover { background: var(--ah-ink-hover); }
.wp-block-button.is-style-outline > .wp-block-button__link { background: transparent; color: var(--ah-ink); border: 1px solid var(--ah-ink-3); padding: 15px 20px; }
.wp-block-button.is-style-outline > .wp-block-button__link:hover { background: var(--ah-hover); border-color: var(--ah-ink); }
.ah-btn-sm .wp-block-button__link { font-size: 13px; padding: 9px 12px !important; }
.wp-block-buttons { gap: 16px; }

/* ---- header ---- */
.ah-header { position: sticky; top: 0; z-index: 50; background: var(--ah-surface); border-bottom: 1px solid var(--ah-line); }
body.admin-bar .ah-header { top: 32px; }
@media (max-width: 782px) { body.admin-bar .ah-header { top: 0; } }
.ah-header-row { display: flex; align-items: center; gap: 24px; min-height: 64px; max-width: 1200px; margin-inline: auto; }
.ah-brand { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; text-decoration: none; color: var(--ah-ink); }
.ah-brand svg { transition: rotate 320ms var(--ah-ease); }
.ah-brand:hover svg { rotate: 90deg; }
.ah-header .wp-block-navigation { font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; gap: 4px; }
.ah-header .wp-block-navigation-item__content { color: var(--ah-ink-2); text-decoration: none; padding: 8px; }
.ah-header .wp-block-navigation-item__content:hover { color: var(--ah-ink); }
.ah-header .ah-header-ctas { margin-left: auto; }
@media (max-width: 719px) { .ah-header .ah-header-ctas { display: none; } .ah-header .wp-block-navigation { margin-left: auto; } }
.wp-block-navigation__responsive-container.is-menu-open { background: var(--ah-surface) !important; padding: 32px 24px; }
.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content { font-size: 32px; letter-spacing: -0.03em; text-transform: none; padding: 8px 0; color: var(--ah-ink); }

/* ---- hero ---- */
.ah-hero { min-height: calc(100svh - 64px); min-height: max(600px, calc(100svh - 64px)); display: flex; flex-direction: column; justify-content: flex-end; padding-block: 48px 40px; border-top: 0; }
.ah-hero > * { position: relative; z-index: 1; }
.ah-hero h1, .ah-hero-title { font-size: clamp(40px, 7.4vw, 104px) !important; line-height: 0.98 !important; letter-spacing: -0.045em !important; max-width: 15ch; text-wrap: balance; margin: 0; }
.ah-page-top { padding-block: 64px 80px; border-top: 0; }
.ah-page-top h1 { font-size: clamp(40px, 7.4vw, 104px) !important; line-height: 0.98 !important; letter-spacing: -0.045em !important; max-width: 16ch; margin: 0; }
.ah-rotate { display: inline-block; transition: opacity 260ms var(--ah-ease), translate 260ms var(--ah-ease); }
.ah-rotate.is-out { opacity: 0; translate: 0 0.25em; }
.ah-field { position: absolute; inset: 0; z-index: 0 !important; width: 100%; height: 100%; display: block; pointer-events: none; margin: 0 !important; }
.ah-hero .ah-field { -webkit-mask-image: linear-gradient(90deg, transparent 38%, #000 88%); mask-image: linear-gradient(90deg, transparent 38%, #000 88%); }
@media (max-width: 719px) { .ah-hero .ah-field { height: 46%; -webkit-mask-image: linear-gradient(0deg, transparent, #000 70%); mask-image: linear-gradient(0deg, transparent, #000 70%); } }
.ah-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; border-top: 1px solid var(--ah-line); padding-top: 24px; }
.ah-facts > * { margin: 0 !important; }
.ah-facts strong { display: block; font-weight: 400; font-size: clamp(20px, 3vw, 32px); letter-spacing: -0.02em; line-height: 1.25; }

/* ---- stack (3 layers) ---- */
.ah-stack { border: 1px solid var(--ah-ink-3); background: var(--ah-surface); }
.ah-layer { display: grid; gap: 16px; padding: 24px; border-top: 1px solid var(--ah-line); position: relative; overflow: hidden; }
.ah-layer:first-child { border-top: 0; }
.ah-layer > * { margin: 0 !important; position: relative; z-index: 1; }
@media (min-width: 720px) { .ah-layer { grid-template-columns: 320px minmax(0, 1fr); align-items: center; padding: 32px; } }
.ah-layer.is-core { background: var(--ah-ink); color: var(--ah-surface); padding-block: 48px; }
@media (min-width: 720px) { .ah-layer.is-core { padding-block: 64px; } }
.ah-layer.is-core .ah-cap { color: var(--ah-surface); font-size: clamp(20px, 3vw, 32px) !important; text-transform: none; letter-spacing: -0.02em; line-height: 1.25; }
.ah-layer .ah-field { -webkit-mask-image: linear-gradient(90deg, transparent 30%, #000); mask-image: linear-gradient(90deg, transparent 30%, #000); left: 40%; width: 60%; }

/* ---- chips & badges ---- */
ul.ah-chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; padding: 0; margin: 0; }
ul.ah-chips > li { display: inline-flex; align-items: center; height: 32px; padding: 0 16px; border: 1px solid var(--ah-ink-3); background: var(--ah-surface); color: var(--ah-ink); font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; margin: 0; }
.ah-layer.is-core ul.ah-chips > li { background: transparent; color: var(--ah-surface); border-color: var(--ah-ink-2); }
ul.ah-tools { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; padding: 0; margin: 0; }
ul.ah-tools > li { display: inline-flex; align-items: center; height: 20px; padding: 0 6px; border: 1px solid var(--ah-ink-3); font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; margin: 0; }
.ah-inhouse { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; background: var(--ah-fill); color: var(--ah-ink); font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; margin: 0; }
.ah-inhouse::before { content: "✓"; }

/* ---- grids with hairline gaps (features, trust, shelf) ---- */
.ah-grid { display: grid !important; gap: 1px; background: var(--ah-line); border: 1px solid var(--ah-ink-3); }
.ah-grid > * { margin: 0 !important; background: var(--ah-surface); padding: 24px; min-width: 0; }
@media (min-width: 560px) { .ah-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .ah-grid.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .ah-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ah-feature { display: flex; flex-direction: column; gap: 16px; min-height: 220px; }
.ah-feature > * { margin: 0 !important; }
.ah-feature .ah-num { font-size: 12px; color: var(--ah-ink-2); letter-spacing: 0.04em; }
.ah-feature .ah-heading { margin-top: auto !important; padding-top: 32px; }

/* ---- numbered steps (how, reasons, install) ---- */
.ah-steps { display: grid !important; gap: 32px; }
@media (min-width: 640px) { .ah-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1040px) { .ah-steps.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } .ah-steps.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ah-step { border-top: 1px solid var(--ah-line); padding-top: 16px; display: flex; flex-direction: column; gap: 8px; margin: 0 !important; }
.ah-step > * { margin: 0 !important; }
.ah-step .ah-title { font-size: clamp(20px, 2.4vw, 28px) !important; }

/* ---- how it works: steps beside a sample screen ---- */
.ah-how { display: grid !important; gap: 48px; align-items: start; }
@media (min-width: 1040px) { .ah-how { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.ah-how > * { margin: 0 !important; }
.ah-how .ah-steps { grid-template-columns: 1fr !important; }
.ah-window { border: 1px solid var(--ah-ink-3); background: var(--ah-surface); font-size: 13px; }
.ah-window-bar { display: flex; align-items: center; gap: 6px; height: 36px; padding: 0 12px; border-bottom: 1px solid var(--ah-line); background: var(--ah-canvas); }
.ah-window-bar i { width: 9px; height: 9px; border-radius: 50%; border: 1px solid var(--ah-ink-3); }
.ah-window-bar span { margin-left: auto; margin-right: auto; font-size: 11px; color: var(--ah-ink-2); letter-spacing: 0.04em; }
.ah-window-body { display: grid; grid-template-columns: 150px minmax(0, 1fr); min-height: 420px; }
.ah-window-nav { border-right: 1px solid var(--ah-line); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.ah-window-nav b { font-weight: 400; display: flex; align-items: center; gap: 6px; padding-bottom: 16px; text-transform: uppercase; letter-spacing: 0.04em; }
.ah-window-nav span { padding: 6px 8px; color: var(--ah-ink-2); }
.ah-window-nav span.is-on { background: var(--ah-ink); color: var(--ah-surface); }
.ah-window-main { padding: 20px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.ah-bubble { max-width: 82%; display: flex; flex-direction: column; gap: 4px; }
.ah-bubble small { font-size: 11px; color: var(--ah-ink-2); text-transform: uppercase; letter-spacing: 0.04em; }
.ah-bubble p { margin: 0; border: 1px solid var(--ah-ink-3); padding: 10px 12px; line-height: 1.5; }
.ah-bubble.me { align-self: flex-end; align-items: flex-end; }
.ah-bubble.me p { background: var(--ah-ink); color: var(--ah-surface); border-color: var(--ah-ink); }
.ah-saved { align-self: flex-start; border: 1px solid var(--ah-ink-3); padding: 6px 10px; text-transform: uppercase; letter-spacing: 0.04em; font-size: 12px; }
.ah-compose { margin-top: auto; border: 1px solid var(--ah-ink-3); padding: 10px 12px; color: var(--ah-ink-3); display: flex; justify-content: space-between; }
@media (max-width: 559px) { .ah-window-body { grid-template-columns: 1fr; } .ah-window-nav { display: none; } }

/* ---- stakes ---- */
.ah-stakes { padding-block: 128px; }
.ah-stakes p { max-width: 28ch; }

/* ---- agents shelf ---- */
.ah-filter { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--ah-ink-3); background: var(--ah-surface); }
.ah-filter button { font: inherit; font-size: 14px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ah-ink-2); background: transparent; border: 0; padding: 10px 16px; cursor: pointer; }
.ah-filter button + button { border-left: 1px solid var(--ah-line); }
.ah-filter button:hover { background: var(--ah-hover); color: var(--ah-ink); }
.ah-filter button[aria-pressed="true"] { background: var(--ah-ink); color: var(--ah-surface); }
.ah-card { display: flex !important; flex-direction: column; gap: 24px; }
@media (min-width: 720px) { .ah-grid > .ah-card { padding: 32px; } }
.ah-card > * { margin: 0 !important; }
.ah-card[hidden] { display: none !important; }
.ah-card-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.ah-card-top > * { margin: 0 !important; }
.ah-card h3 { font-size: clamp(22px, 2.4vw, 28px) !important; letter-spacing: -0.02em !important; line-height: 1.2; margin: 0 0 8px !important; }
.ah-win { background: var(--ah-fill); padding: 16px; display: flex; flex-direction: column; gap: 4px; }
.ah-win > * { margin: 0 !important; }
.ah-approve { display: flex; gap: 8px; align-items: flex-start; }
.ah-approve::before { content: ""; flex: none; width: 14px; height: 14px; margin-top: 1px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E") center / contain no-repeat; }
.ah-price { margin-top: auto !important; border-top: 1px solid var(--ah-line); padding-top: 16px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; }
.ah-price > * { margin: 0 !important; }
.ah-price p strong { display: block; font-weight: 400; font-size: 18px; letter-spacing: 0.02em; text-transform: uppercase; font-variant-numeric: tabular-nums; }

/* ---- bundles ---- */
.ah-bundles { display: grid !important; gap: 24px; }
@media (min-width: 960px) { .ah-bundles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.ah-bundle { border: 1px solid var(--ah-ink-3); background: var(--ah-surface); display: flex; flex-direction: column; margin: 0 !important; }
.ah-bundle-art { position: relative; height: 192px; border-bottom: 1px solid var(--ah-line); overflow: hidden; margin: 0 !important; }
.ah-bundle-art.is-dark { background: var(--ah-ink); }
.ah-bundle-body { padding: 24px; display: flex; flex-direction: column; gap: 24px; flex: 1; margin: 0 !important; }
@media (min-width: 720px) { .ah-bundle-body { padding: 32px; } }
.ah-bundle-body > * { margin: 0 !important; }
ul.ah-checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
ul.ah-checks > li::before { content: "✓  "; }

/* ---- faq ---- */
.ah-faq { display: grid !important; gap: 48px; }
@media (min-width: 960px) { .ah-faq { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } .ah-faq > :first-child { position: sticky; top: 96px; align-self: start; } }
.ah-faq > * { margin: 0 !important; }
.ah-faq-list { border-top: 1px solid var(--ah-line); }
.ah-faq-list > * { margin: 0 !important; }
.ah-faq-list details { border-bottom: 1px solid var(--ah-line); }
.ah-faq-list summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 24px; padding: 24px 0; font-size: 18px; line-height: 1.33; letter-spacing: 0.02em; text-transform: uppercase; }
.ah-faq-list summary::-webkit-details-marker { display: none; }
.ah-faq-list summary::after { content: "+"; font-size: 22px; transition: rotate 320ms var(--ah-ease); flex: none; }
.ah-faq-list details[open] summary::after { rotate: 45deg; }
.ah-faq-list details > p { margin: 0 0 24px !important; color: var(--ah-ink-2); max-width: 60ch; }

/* ---- cta ---- */
.ah-cta { padding-block: 128px 160px; }
.ah-cta .ah-field { left: auto; right: 0; width: 50%; -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%); mask-image: linear-gradient(90deg, transparent, #000 45%); }
@media (max-width: 959px) { .ah-cta { padding-bottom: 280px; } .ah-cta .ah-field { top: auto; bottom: 0; width: 100%; height: 220px; -webkit-mask-image: linear-gradient(0deg, #000 45%, transparent); mask-image: linear-gradient(0deg, #000 45%, transparent); } }
.ah-cta h2 { font-size: clamp(40px, 5.6vw, 80px) !important; line-height: 1 !important; letter-spacing: -0.04em !important; max-width: 13ch; }

/* ---- footer ---- */
.ah-footer { border-top: 1px solid var(--ah-line); padding-block: 64px 32px; overflow: hidden; }
.ah-footer-grid { display: grid !important; gap: 48px; max-width: 1200px; margin-inline: auto; }
@media (min-width: 960px) { .ah-footer-grid { grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); } }
.ah-footer-grid > * { margin: 0 !important; }
.ah-footer-cols { display: grid !important; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 32px; }
@media (min-width: 640px) { .ah-footer-cols { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.ah-footer-cols > * { margin: 0 !important; display: flex; flex-direction: column; gap: 8px; }
.ah-footer-cols > * > * { margin: 0 !important; }
.ah-footer-cols ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ah-footer-cols a { text-decoration: none; }
.ah-footer-cols a:hover { text-decoration: underline; }
.ah-wordmark { max-width: 1200px; margin: 48px auto 0 !important; font-size: clamp(32px, 10.4vw, 152px) !important; line-height: 0.84 !important; letter-spacing: -0.06em !important; white-space: nowrap; }
.ah-wordmark a { text-decoration: none; }
.ah-footer-meta { max-width: 1200px; margin: 32px auto 0 !important; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 24px; }

/* ---- blog ---- */
.ah-blog-head { padding-block: 64px 48px; border-top: 0; }
.ah-postlist .wp-block-post-template { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--ah-line); }
.ah-postlist .wp-block-post { border-bottom: 1px solid var(--ah-line); padding: 24px 0; margin: 0 !important; display: grid; gap: 8px; }
@media (min-width: 720px) { .ah-postlist .wp-block-post { grid-template-columns: 160px minmax(0, 1fr); column-gap: 32px; } .ah-postlist .wp-block-post > :not(.wp-block-post-date) { grid-column: 2; } .ah-postlist .wp-block-post-date { grid-row: 1 / span 2; } }
.ah-postlist .wp-block-post > * { margin: 0 !important; }
.ah-postlist .wp-block-post-title { font-size: clamp(18px, 2vw, 24px) !important; letter-spacing: -0.01em; line-height: 1.3; }
.ah-postlist .wp-block-post-title a { text-decoration: none; }
.ah-postlist .wp-block-post-title a:hover { text-decoration: underline; }
.ah-postlist .wp-block-post-excerpt__excerpt { color: var(--ah-ink-2); margin: 0; }
.ah-postlist .wp-block-query-pagination { margin-top: 32px; text-transform: uppercase; letter-spacing: 0.04em; }
.ah-article { padding-block: 48px 96px; }
.ah-article .wp-block-post-title { font-size: clamp(32px, 4.6vw, 56px) !important; line-height: 1.06; letter-spacing: -0.035em; text-wrap: balance; }
.ah-article .wp-block-post-content { font-size: 15px; line-height: 1.75; }
.ah-article .wp-block-post-content :where(h2) { font-size: 24px; letter-spacing: -0.02em; margin-top: 48px; }
.ah-article .wp-block-post-content :where(h3) { font-size: 18px; margin-top: 32px; }
.ah-article .wp-block-post-content img { height: auto; }
.ah-back { text-decoration: none; }
.ah-header, .ah-footer { padding-inline: clamp(24px, 4vw, 48px); }
.ah-field { max-width: none !important; }
.ah-hero > * + *, .ah-page-top > * + * { margin-block-start: 32px; }
.ah-cta > * + * { margin-block-start: 24px; }
.ah-band > .ah-field, .ah-layer > .ah-field, .ah-bundle-art > .ah-field { position: absolute !important; z-index: 0 !important; }
/* Narrow text inside a 1200px band sits on the band's left edge, not centered */
.ah-band.is-layout-constrained > :where(h1, h2, p, .wp-block-heading, .wp-block-buttons) { margin-left: max(0px, calc((100% - 1200px) / 2)) !important; margin-right: auto !important; }
/* legal pages */
.ah-legal { padding-top: 0; border-top: 0; }
.ah-legal > * { max-width: 720px; margin-left: max(0px, calc((100% - 1200px) / 2)) !important; margin-right: auto !important; }
.ah-legal h2 { font-size: 18px; letter-spacing: 0.02em; text-transform: uppercase; margin-top: 48px !important; }
.ah-legal p, .ah-legal li { font-size: 15px; line-height: 1.75; }
.ah-legal ul { padding-left: 1.2em; }
.ah-legal li + li { margin-top: 8px; }
.ah-footer-meta .ah-legal-links { display: inline-flex; gap: 16px; }
