/*
Theme Name: AIPolish
Theme URI: https://aipolish.pl
Author: Janusz Rudzki
Author URI: https://aipolish.pl/meet-the-founder-janusz-rudzki/
Description: Custom hand-coded theme for AIPolish.pl — black background, red neon accents, circuit aesthetic, glass panels. No page builder required.
Version: 1.15.3
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
Text Domain: aipolish
*/

:root {
  --bg: #060607;
  --panel: #0d0d10;
  --glass: rgba(255, 255, 255, 0.045);
  --glass-strong: rgba(255, 255, 255, 0.07);
  --line: rgba(255, 255, 255, 0.09);
  --red: #ff2b3a;
  --red-deep: #c1121f;
  --glow: rgba(255, 43, 58, 0.45);
  --glow-soft: rgba(255, 43, 58, 0.16);
  --text: #f4f3ef;
  --muted: #a3a3ad;
  --radius: 16px;
  --font-display: "Unbounded", sans-serif;
  --font-body: "Sora", sans-serif;
  --maxw: 1120px;
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
}

/* Circuit backdrop — very faint grid with node dots */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 43, 58, 0.10) 1px, transparent 1.5px),
    linear-gradient(rgba(255,255,255,0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.025) 1px, transparent 1px);
  background-size: 96px 96px, 96px 96px, 96px 96px;
  pointer-events: none;
}

img { max-width: 100%; height: auto; display: block; border-radius: var(--radius); }
a { color: var(--red); text-decoration: none; }
a:hover { text-decoration: underline; }
a:focus-visible, button:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 3px;
  border-radius: 4px;
}

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.25;
  color: var(--text);
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(1.9rem, 4.5vw, 3.1rem); }
h2 { font-size: clamp(1.4rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ===== Signature: circuit underline on section headings ===== */
.circuit-head {
  position: relative;
  display: inline-block;
  padding-bottom: 18px;
  margin-bottom: 28px;
}
.circuit-head::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 72px;
  height: 2px;
  background: var(--red);
  box-shadow: 0 0 12px var(--glow);
}
.circuit-head::before {
  content: "";
  position: absolute;
  left: 72px;
  bottom: -3px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 14px var(--glow), 0 0 4px var(--red);
}

/* ===== Header ===== */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: rgba(6, 6, 7, 0.78);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 14px 24px;
  max-width: var(--maxw);
  margin: 0 auto;
}
.site-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.site-brand:hover { text-decoration: none; }
.site-brand .brand-logo {
  width: 76px; height: 76px;
  border-radius: 50%;
  box-shadow: 0 0 22px var(--glow-soft);
  flex-shrink: 0;
}
@media (max-width: 920px) {
  .site-brand .brand-logo { width: 56px; height: 56px; }
}
.site-brand .brand-name {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--text);
  letter-spacing: 0.02em;
}
.site-brand .brand-name span { color: var(--red); }

/* ===== Navigation ===== */
.main-nav ul { list-style: none; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.main-nav li { position: relative; }
.main-nav a {
  display: block;
  padding: 10px 14px;
  color: var(--text);
  font-size: 0.92rem;
  border-radius: 10px;
  white-space: nowrap;
  transition: background 0.15s, color 0.15s;
}
.main-nav a:hover { background: var(--glass-strong); text-decoration: none; color: #fff; }
.main-nav .current-menu-item > a,
.main-nav .current_page_item > a { color: var(--red); }

.main-nav ul ul {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 250px;
  flex-direction: column;
  gap: 0;
  background: rgba(13, 13, 16, 0.96);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px;
  display: none;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.55), 0 0 0 1px var(--glow-soft);
}
.main-nav li:hover > ul,
.main-nav li:focus-within > ul { display: flex; }
.main-nav ul ul a { padding: 9px 12px; font-size: 0.88rem; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  color: var(--text);
  font-size: 1.1rem;
  cursor: pointer;
}

@media (max-width: 920px) {
  .nav-toggle { display: block; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: rgba(8, 8, 10, 0.98);
    border-bottom: 1px solid var(--line);
    padding: 12px 24px 20px;
    max-height: calc(100vh - 76px);
    overflow-y: auto;
  }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; align-items: stretch; }
  .main-nav ul ul {
    position: static;
    display: flex;
    box-shadow: none;
    border: none;
    background: none;
    padding-left: 16px;
  }
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  font-family: var(--font-display);
  font-size: 0.92rem;
  font-weight: 500;
  padding: 14px 28px;
  border-radius: 999px;
  border: 1px solid var(--red);
  color: #fff;
  background: linear-gradient(180deg, var(--red), var(--red-deep));
  box-shadow: 0 0 22px var(--glow), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform 0.15s, box-shadow 0.15s;
}
.btn:hover { text-decoration: none; transform: translateY(-2px); box-shadow: 0 0 34px var(--glow); }
.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid rgba(255, 43, 58, 0.55);
  box-shadow: 0 0 12px var(--glow-soft);
}
.btn-ghost:hover { border-color: var(--red); color: #fff; box-shadow: 0 0 22px var(--glow); }

/* ===== Glass panels ===== */
.glass {
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: 28px;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s;
}
.glass:hover {
  border-color: rgba(255, 43, 58, 0.4);
  box-shadow: 0 0 30px var(--glow-soft);
  transform: translateY(-3px);
}

/* ===== Hero ===== */
.hero { padding: 88px 0 64px; text-align: left; position: relative; }
.hero .eyebrow {
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 18px;
}
.hero h1 { max-width: 17ch; margin-bottom: 22px; }
.hero h1 em { font-style: normal; color: var(--red); text-shadow: 0 0 24px var(--glow); }
.hero p.lede { max-width: 56ch; color: var(--muted); font-size: 1.08rem; margin-bottom: 34px; }
.hero .cta-row { display: flex; gap: 14px; flex-wrap: wrap; }

/* ===== Sections ===== */
.section { padding: 64px 0; }
.section-alt { background: var(--panel); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

.grid { display: grid; gap: 20px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 920px) { .grid-3 { grid-template-columns: 1fr; } .grid-2 { grid-template-columns: 1fr; } }

.card h3 { margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.97rem; }
.card .card-icon {
  width: 46px; height: 46px;
  display: grid; place-items: center;
  border-radius: 12px;
  border: 1px solid rgba(255, 43, 58, 0.45);
  color: var(--red);
  margin-bottom: 18px;
  box-shadow: 0 0 16px var(--glow-soft);
}
.card .card-icon svg { width: 24px; height: 24px; stroke: var(--red); fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 6px var(--glow)); }


/* ===== Prose (page/post content) ===== */
.prose { max-width: 760px; }
.prose > * + * { margin-top: 1.2em; }
.prose h2, .prose h3 { margin-top: 1.8em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.5em; }
.prose blockquote {
  border-left: 2px solid var(--red);
  padding: 4px 0 4px 20px;
  color: var(--muted);
  box-shadow: -6px 0 20px -12px var(--glow);
}
.prose img { border: 1px solid var(--line); }
.prose code { background: var(--glass-strong); padding: 2px 7px; border-radius: 6px; font-size: 0.9em; }

/* ===== Blog cards ===== */
.post-card { overflow: hidden; padding: 0; display: flex; flex-direction: column; }
.post-card .thumb img { border-radius: 0; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.post-card .post-body { padding: 24px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.post-card .meta { font-size: 0.8rem; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.post-card h3 a { color: var(--text); }
.post-card h3 a:hover { color: var(--red); text-decoration: none; }

/* ===== Page header band ===== */
.page-band { padding: 64px 0 44px; border-bottom: 1px solid var(--line); }
.page-band .eyebrow {
  font-family: var(--font-display);
  font-size: 0.75rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--red);
  margin-bottom: 14px;
}

/* ===== Newsletter ===== */
.newsletter { padding: 56px 24px 8px; max-width: 720px; margin: 0 auto; }
.newsletter-inner { text-align: center; padding: 40px 32px; }
.newsletter-inner:hover { transform: none; }
.newsletter h2 { margin-bottom: 12px; }
.newsletter p { color: var(--muted); font-size: 0.97rem; max-width: 52ch; margin: 0 auto; }
.nl-form { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 24px; }
.nl-form input[type="email"],
.nl-form input[type="text"] {
  flex: 1 1 260px;
  max-width: 340px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 14px 22px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.nl-form input[type="email"]:focus,
.nl-form input[type="text"]:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 16px var(--glow-soft);
}
.nl-form .btn { border: 1px solid var(--red); cursor: pointer; }
.nl-msg { margin-top: 18px; font-size: 0.95rem; }
.nl-ok { color: #7ee2a8; }
.nl-err { color: var(--red); }
.nl-privacy { margin-top: 16px; font-size: 0.78rem !important; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--line); margin-top: 80px; background: var(--panel); }
.footer-logo { display: flex; justify-content: center; padding-top: 52px; }
.footer-logo img {
  width: 150px; height: 150px;
  border-radius: 50%;
  box-shadow: 0 0 40px var(--glow-soft), 0 0 90px rgba(255, 43, 58, 0.08);
}
.footer-statement {
  text-align: center;
  padding: 28px 24px 8px;
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2.4vw, 1.5rem);
  color: var(--text);
}
.footer-statement strong { color: var(--red); font-weight: 500; text-shadow: 0 0 20px var(--glow); }
.footer-tagline {
  text-align: center;
  color: var(--muted);
  max-width: 62ch;
  margin: 14px auto 0;
  padding: 0 24px;
  font-size: 0.95rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  padding: 48px 24px;
  max-width: var(--maxw);
  margin: 0 auto;
}
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-grid h4 { font-size: 0.85rem; letter-spacing: 0.14em; text-transform: uppercase; margin-bottom: 14px; color: var(--muted); }
.footer-grid ul { list-style: none; }
.footer-grid li { margin-bottom: 8px; }
.footer-grid a { color: var(--text); font-size: 0.92rem; }
.footer-grid a:hover { color: var(--red); text-decoration: none; }
.footer-bottom {
  border-top: 1px solid var(--line);
  text-align: center;
  padding: 20px 24px;
  color: var(--muted);
  font-size: 0.82rem;
}
.footer-social { display: flex; gap: 16px; justify-content: center; margin-top: 18px; }
.footer-social a { color: var(--muted); font-size: 0.9rem; }
.footer-social a:hover { color: var(--red); }

/* ===== Utilities ===== */
.step-num {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--red);
  text-shadow: 0 0 16px var(--glow);
  margin-bottom: 12px;
}
.tag {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.66rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--red);
  border: 1px solid rgba(255, 43, 58, 0.45);
  border-radius: 999px;
  padding: 3px 10px;
  margin-left: 8px;
  vertical-align: middle;
}
.cta-row { display: flex; gap: 14px; flex-wrap: wrap; }
.screen-reader-text {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.center { text-align: center; }
.mt-2 { margin-top: 20px; }
.mt-4 { margin-top: 40px; }

/* Pagination */
.pagination { display: flex; gap: 8px; justify-content: center; margin-top: 44px; flex-wrap: wrap; }
.pagination .page-numbers {
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--text);
  font-size: 0.9rem;
}
.pagination .page-numbers.current { border-color: var(--red); color: var(--red); box-shadow: 0 0 14px var(--glow-soft); }
.pagination a.page-numbers:hover { border-color: var(--red); text-decoration: none; }

/* ===== Video embed ===== */
.video-embed {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: 0 0 30px var(--glow-soft);
}
.video-embed iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* ===== Partner directory & form ===== */
.ap-filters { display: flex; gap: 14px; align-items: center; flex-wrap: wrap; margin-bottom: 26px; color: var(--muted); font-size: 0.92rem; }
.ap-filters select, .ap-filters input[type="search"] {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 18px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.9rem;
}
.ap-filters select:focus, .ap-filters input:focus { outline: none; border-color: var(--red); box-shadow: 0 0 14px var(--glow-soft); }
.ap-filters select option { background: var(--panel); color: var(--text); }
.ap-card { position: relative; }
.ap-avatar {
  width: 52px; height: 52px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 43, 58, 0.5);
  color: var(--red);
  font-family: var(--font-display);
  font-size: 1.3rem;
  margin-bottom: 16px;
  box-shadow: 0 0 16px var(--glow-soft);
}
.ap-meta { font-size: 0.85rem !important; }
.ap-langs { font-size: 0.92rem !important; color: var(--text) !important; }
.ap-contact { font-size: 0.92rem !important; color: var(--text) !important; border-top: 1px solid var(--line); padding-top: 12px; margin-top: 4px; }
.ap-empty { color: var(--muted); margin-top: 18px; }

.ap-form-wrap { max-width: 760px; margin: 0 auto; }
.ap-form-wrap:hover { transform: none; }
.ap-form label { display: block; margin-top: 18px; font-size: 0.88rem; color: var(--muted); }
.ap-form input[type="text"], .ap-form input[type="email"], .ap-form textarea, .ap-form select {
  display: block;
  width: 100%;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px 16px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 0.95rem;
}
.ap-form input:focus, .ap-form textarea:focus, .ap-form select:focus { outline: none; border-color: var(--red); box-shadow: 0 0 14px var(--glow-soft); }
.ap-form select option { background: var(--panel); color: var(--text); }
.ap-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 700px) { .ap-row { grid-template-columns: 1fr; } }
.ap-consent { display: flex !important; gap: 10px; align-items: flex-start; font-size: 0.82rem !important; margin-top: 22px !important; }
.ap-consent input { margin-top: 4px; }
.ap-form .cta-row { margin-top: 26px; }
.ap-form .btn { cursor: pointer; }
.ap-hp { position: absolute; left: -9999px; }
.ap-remove { margin-top: 18px; }
.ap-remove .btn { cursor: pointer; font-size: 0.8rem; padding: 10px 20px; }

/* ===== Founder page ===== */
.founder-photo img {
  border-radius: var(--radius);
  border: 1px solid rgba(255, 43, 58, 0.35);
  box-shadow: 0 0 40px var(--glow-soft), 0 24px 60px rgba(0, 0, 0, 0.5);
  width: 100%;
  max-width: 440px;
  margin: 0 auto;
}
.founder-badges { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.founder-badges .tag { margin-left: 0; font-size: 0.75rem; padding: 6px 14px; }

/* ===== Nav fixes: right-align the last dropdown (More), tighten spacing ===== */
.main-nav > ul > li:last-child > ul {
  left: auto;
  right: 0;
}
@media (min-width: 921px) and (max-width: 1420px) {
  .main-nav a { font-size: 0.85rem; padding: 9px 10px; }
}

/* ===== AI bridge button ===== */
.ai-bridge-wrap { padding: 30px 0 0; }
.ai-bridge-wrap .wrap { text-align: center; }
.ai-bridge { font-size: 1rem; padding: 17px 34px; display: inline-block; }
.ai-bridge span { margin-left: 6px; }
@media (max-width: 700px) { .ai-bridge { font-size: 0.85rem; padding: 14px 24px; } }

/* ===== Story typography (ASPEKT) ===== */
.story-prose { font-size: 1.05rem; line-height: 1.9; }
.story-prose hr { border: 0; height: 1px; background: var(--line); margin: 2.4em auto; width: 120px; box-shadow: 0 0 12px var(--glow-soft); }

/* ===== Learning loop visual ===== */
.loop {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: center;
  max-width: 900px;
  margin: 0 auto;
}
.loop-step {
  font-family: var(--font-display);
  font-size: 0.92rem;
  padding: 12px 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(8px);
}
.loop-arrow { color: var(--red); text-shadow: 0 0 10px var(--glow); font-size: 1.1rem; }
.loop-final {
  border-color: var(--red);
  color: #fff;
  background: linear-gradient(180deg, var(--red), var(--red-deep));
  box-shadow: 0 0 22px var(--glow);
}
@media (max-width: 700px) { .loop-step { font-size: 0.78rem; padding: 9px 15px; } }

/* ===== Mobile quick tabs ===== */
.quick-tabs { display: none; }
@media (max-width: 920px) {
  .quick-tabs {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  .quick-tabs::-webkit-scrollbar { display: none; }
  .quick-tabs a {
    flex: 0 0 auto;
    font-family: var(--font-display);
    font-size: 0.72rem;
    letter-spacing: 0.02em;
    color: var(--text);
    padding: 9px 15px;
    border: 1px solid rgba(255, 43, 58, 0.45);
    border-radius: 999px;
    background: var(--glass);
    white-space: nowrap;
  }
  .quick-tabs a:hover { text-decoration: none; border-color: var(--red); }
}

/* ===== Header social icons ===== */
.header-socials { display: flex; gap: 8px; align-items: center; margin-left: 14px; }
.soc {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(255, 43, 58, 0.45);
  border-radius: 50%;
  color: var(--text);
  background: var(--glass);
  flex: 0 0 auto;
  transition: border-color 0.2s, box-shadow 0.2s, color 0.2s;
}
.soc:hover { border-color: var(--red); color: #fff; box-shadow: 0 0 16px var(--glow); text-decoration: none; }
@media (max-width: 920px) {
  .header-socials { margin-left: auto; margin-right: 10px; order: 2; }
  .nav-toggle { order: 3; }
  .header-socials .soc { width: 32px; height: 32px; }
}

/* ===== Footer statement attribution ===== */
.footer-statement { max-width: 30ch; margin-left: auto; margin-right: auto; }
@media (min-width: 700px) { .footer-statement { max-width: 46ch; } }
.footer-attrib { text-align: center; color: var(--muted); font-size: 0.9rem; padding-top: 10px; }
