/* Light "glass" theme: frosted translucent panels over a soft colour wash. */
:root {
  --bg: #f5f5f7;
  --text: #1d1d1f;
  --muted: #6e6e73;
  --accent: #0071e3;
  --accent-soft: rgba(0, 113, 227, 0.1);
  --glass: rgba(255, 255, 255, 0.58);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --glass-border: rgba(255, 255, 255, 0.75);
  --hairline: rgba(0, 0, 0, 0.07);
  --shadow: 0 1px 1px rgba(0, 0, 0, 0.02), 0 10px 30px rgba(30, 40, 90, 0.08);
  --shadow-hover: 0 2px 4px rgba(0, 0, 0, 0.03), 0 20px 44px rgba(30, 40, 90, 0.14);
  --blur: blur(22px) saturate(180%);
  --code-bg: rgba(0, 0, 0, 0.045);
  --radius: 22px;
  --radius-sm: 14px;
  --maxw: 1160px;
  color-scheme: light;
}

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

html { background: var(--bg); }

body {
  margin: 0;
  min-height: 100vh;
  /* No background here: html paints the base colour, so the fixed wash below shows through. */
  color: var(--text);
  font: 17px/1.7 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI Variable", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  position: relative;
}

/* Colour wash behind the glass */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    radial-gradient(45vmax 45vmax at 8% 5%, rgba(100, 160, 255, 0.55), transparent 62%),
    radial-gradient(40vmax 40vmax at 95% 10%, rgba(255, 140, 200, 0.45), transparent 62%),
    radial-gradient(46vmax 46vmax at 80% 90%, rgba(150, 110, 255, 0.42), transparent 62%),
    radial-gradient(42vmax 42vmax at 5% 95%, rgba(90, 225, 195, 0.42), transparent 62%);
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 8px; background: #fff; padding: 8px 12px; border-radius: 10px; z-index: 10; }

/* Shared glass surface */
.glass, .card, .cat-tile, .post, .toc, .post-foot, .site-footer, .page-body, .search input {
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

/* header: see "Floating header" section at the end */

/* home hero */
.hero { padding: 64px 0 56px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; }
.hero h1 {
  font-size: clamp(2.2rem, 5vw, 3.8rem); line-height: 1.06; letter-spacing: -0.035em; font-weight: 700;
  margin: 0 0 18px;
  background: linear-gradient(120deg, #1d1d1f 20%, #0a5ad6 55%, #8e3bd8 85%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero .lead { margin: 0; }
.lead { font-size: 1.18rem; line-height: 1.6; color: var(--muted); max-width: 700px; margin-top: 0; }
.search { display: block; max-width: 620px; margin: 30px 0 0; }

/* hero: real-time 3D scene (hero3d.js) over a soft glow */
.hero-visual { position: relative; height: 540px; }
.hero-3d { cursor: grab; touch-action: pan-y; }
.hero-3d:active { cursor: grabbing; }
.orb {
  /* Shown before the 3D scene starts (and instead of it without WebGL); stays as a glow behind it. */
  position: absolute; left: 50%; top: 48%; width: 62%; aspect-ratio: 1; transform: translate(-50%, -50%);
  border-radius: 50%; filter: blur(30px); opacity: 0.85;
  background: radial-gradient(circle at 35% 30%, rgba(100, 210, 255, 0.9), rgba(10, 132, 255, 0.55) 40%, rgba(191, 90, 242, 0.45) 65%, transparent 72%);
}
.hero-3d::after {
  /* contact shadow under the floating object */
  content: ""; position: absolute; left: 28%; right: 28%; bottom: 4%; height: 26px; border-radius: 50%;
  background: radial-gradient(closest-side, rgba(40, 30, 110, 0.28), transparent); filter: blur(6px);
}
.gl3d { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; opacity: 0; transition: opacity 0.9s ease; }
.is-3d .gl3d { opacity: 1; }
.chip {
  position: absolute; z-index: 3; display: flex; align-items: center; gap: 8px;
  padding: 10px 16px; border-radius: 99px; font-size: 0.85rem; font-weight: 500; white-space: nowrap;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--glass-border); box-shadow: var(--shadow-hover);
  will-change: transform;
}
.chip-1 { left: 2%; bottom: 14%; }
.chip-2 { right: 2%; top: 6%; }
.chip-3 { left: 4%; top: 18%; }
.dot { width: 9px; height: 9px; border-radius: 50%; }
.dot.ok { background: #30d158; box-shadow: 0 0 10px #30d158; }
.dot.warn { background: #ff9f0a; box-shadow: 0 0 10px #ff9f0a; }
@media (max-width: 900px) {
  .hero { padding-top: 40px; }
  .hero-grid { grid-template-columns: 1fr; gap: 28px; text-align: center; }
  .hero .lead, .search { margin-left: auto; margin-right: auto; }
  .hero-visual { height: 400px; max-width: 520px; width: 100%; margin: 0 auto; }
  .chip { font-size: 0.78rem; padding: 8px 12px; }
}
.search input {
  width: 100%; padding: 16px 24px; font: inherit; font-size: 1rem; color: var(--text);
  border-radius: 99px; background: var(--glass-strong);
}
.search input::placeholder { color: #8e8e93; }
.search input:focus { outline: none; border-color: rgba(0, 113, 227, 0.5); box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.15), var(--shadow); }

.cat-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px; margin-bottom: 52px; }
.cat-tile {
  display: flex; flex-direction: column; gap: 2px; padding: 18px 20px; border-radius: var(--radius-sm);
  color: var(--text); line-height: 1.35; transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.cat-tile:nth-child(1) { --dot: #0a84ff; }
.cat-tile:nth-child(2) { --dot: #30d158; }
.cat-tile:nth-child(3) { --dot: #ff375f; }
.cat-tile:nth-child(4) { --dot: #ff9f0a; }
.cat-tile:nth-child(5) { --dot: #64d2ff; }
.cat-tile:nth-child(6) { --dot: #bf5af2; }
.cat-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow-hover); text-decoration: none; }
.section-title { font-size: 1.75rem; letter-spacing: -0.02em; margin: 0 0 20px; }

/* cards */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 20px; margin-bottom: 56px; }
.card {
  border-radius: var(--radius); padding: 24px 24px 20px; display: flex; flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); background: var(--glass-strong); }
.card-img { display: block; margin: -14px -14px 16px; border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 9; background: rgba(0, 0, 0, 0.04); }
.card-img img { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover .card-img img { transform: scale(1.04); }
.post-hero { margin: 8px 0 28px; border-radius: 20px; overflow: hidden; aspect-ratio: 16 / 9; box-shadow: var(--shadow); }
.post-hero img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card[hidden] { display: none; }
.card h3 { font-size: 1.12rem; line-height: 1.35; letter-spacing: -0.01em; margin: 12px 0 8px; }
.card h3 a { color: var(--text); }
.card h3 a:hover { color: var(--accent); text-decoration: none; }
.card p { margin: 0 0 12px; color: var(--muted); font-size: 0.95rem; line-height: 1.55; }
.card-meta { margin-top: auto !important; }
.card-cat {
  align-self: flex-start; font-size: 0.72rem; font-weight: 600; letter-spacing: 0.02em;
  background: var(--accent-soft); color: var(--accent); padding: 4px 10px; border-radius: 99px;
}
.card-cat:hover { text-decoration: none; background: rgba(0, 113, 227, 0.16); }

/* post */
.narrow-top { padding-top: 40px; }
.narrow-top h1 { font-size: clamp(2rem, 4vw, 2.8rem); letter-spacing: -0.03em; margin: 8px 0 8px; }
.post-layout { display: grid; grid-template-columns: minmax(0, 1fr) 270px; gap: 32px; padding-top: 32px; align-items: start; }
.post { max-width: 800px; min-width: 0; border-radius: 28px; padding: 44px 52px; background: var(--glass-strong); }
.post h1 { font-size: clamp(1.9rem, 3.8vw, 2.7rem); line-height: 1.14; letter-spacing: -0.03em; margin: 10px 0 12px; }
.crumbs a { color: var(--muted); }
.sidebar .toc { position: sticky; top: 80px; }
.toc { border-radius: var(--radius); padding: 20px 22px; font-size: 0.88rem; line-height: 1.5; }
.toc-title { font-weight: 600; margin: 0 0 10px; }
.toc ol { margin: 0; padding-left: 18px; }
.toc li { margin-bottom: 7px; }
.toc a { color: var(--muted); }
.toc a:hover { color: var(--accent); text-decoration: none; }
.toc-mobile { display: none; }
@media (max-width: 980px) {
  .post-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .toc-mobile { display: block; margin: 22px 0; }
  .toc-mobile .toc { box-shadow: none; background: rgba(255, 255, 255, 0.5); }
}
@media (max-width: 640px) {
  .post { padding: 28px 20px; border-radius: 22px; }
}
.post-foot { margin: 40px 0 0; padding: 18px 22px; border-radius: var(--radius-sm); font-size: 0.95rem; box-shadow: none; }
.post-foot p { margin: 0; }
.related { padding-top: 48px; }
.related h2 { font-size: 1.6rem; letter-spacing: -0.02em; }

/* prose */
.prose h2 { font-size: 1.6rem; line-height: 1.25; letter-spacing: -0.02em; margin: 2.1em 0 0.6em; scroll-margin-top: 80px; }
.prose h3 { font-size: 1.18rem; line-height: 1.4; letter-spacing: -0.01em; margin: 1.8em 0 0.4em; }
.prose p, .prose ul, .prose ol { margin: 0 0 1.1em; }
.prose li { margin-bottom: 0.4em; }
.prose code { font: 0.86em/1.5 "SF Mono", ui-monospace, Menlo, Consolas, monospace; background: var(--code-bg); padding: 0.15em 0.45em; border-radius: 6px; overflow-wrap: anywhere; }
.prose pre { background: rgba(29, 29, 31, 0.92); color: #f5f5f7; border-radius: var(--radius-sm); padding: 18px 20px; overflow-x: auto; margin: 0 0 1.4em; box-shadow: var(--shadow); }
.prose pre code { background: none; padding: 0; font-size: 0.84rem; color: inherit; overflow-wrap: normal; }
.prose table { border-collapse: separate; border-spacing: 0; width: 100%; margin: 0 0 1.4em; font-size: 0.92rem; display: block; overflow-x: auto; border-radius: var(--radius-sm); border: 1px solid var(--hairline); }
.prose th, .prose td { border-bottom: 1px solid var(--hairline); padding: 10px 14px; text-align: left; vertical-align: top; }
.prose tr:last-child td { border-bottom: 0; }
.prose th { background: rgba(0, 0, 0, 0.03); font-weight: 600; }
.prose blockquote { margin: 0 0 1.2em; padding: 4px 18px; border-left: 3px solid var(--hairline); color: var(--muted); }
.tldr, .note, .warning { border-radius: var(--radius-sm); padding: 16px 20px; margin: 0 0 1.5em; border: 1px solid; }
.tldr p:last-child, .note p:last-child, .warning p:last-child { margin-bottom: 0; }
.tldr { background: rgba(48, 209, 88, 0.1); border-color: rgba(48, 209, 88, 0.35); }
.note { background: rgba(10, 132, 255, 0.08); border-color: rgba(10, 132, 255, 0.3); }
.warning { background: rgba(255, 159, 10, 0.1); border-color: rgba(255, 159, 10, 0.4); }

/* static pages */
.page-body { max-width: 820px; margin: 40px auto 0; padding: 44px 52px; border-radius: 28px; background: var(--glass-strong); }
.page-body h1 { font-size: 2.3rem; line-height: 1.15; letter-spacing: -0.03em; margin: 0 0 10px; }
@media (max-width: 640px) { .page-body { margin: 24px 16px 0; padding: 28px 20px; } }

/* footer */
.site-footer { border-radius: 0; border-width: 1px 0 0; margin-top: 64px; padding: 40px 0 24px; font-size: 0.92rem; box-shadow: none; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1.4fr; gap: 32px; }
.footer-brand { font-weight: 600; margin: 0 0 6px; }
.footer-title { font-weight: 600; margin: 0 0 8px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer a { color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.copyright { margin-top: 28px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 20px; } }

/* Browsers without backdrop-filter, or users who ask for less transparency */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root { --glass: rgba(255, 255, 255, 0.9); --glass-strong: rgba(255, 255, 255, 0.96); }
}
@media (prefers-reduced-transparency: reduce) {
  :root { --glass: #fff; --glass-strong: #fff; }
}
@media (prefers-reduced-motion: reduce) {
  .card, .cat-tile { transition: none; }
  .card:hover, .cat-tile:hover { transform: none; }
}

/* ===================== Floating header ===================== */
@property --spin { syntax: "<angle>"; inherits: false; initial-value: 0deg; }

.site-header { position: sticky; top: 12px; z-index: 20; padding: 0 16px; margin-top: 12px; }
.nav-shell {
  position: relative; max-width: var(--maxw); margin: 0 auto; height: 62px;
  display: flex; align-items: center; gap: 10px; padding: 0 10px 0 18px; border-radius: 99px;
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(24px) saturate(190%); backdrop-filter: blur(24px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 8px 32px rgba(30, 40, 90, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: height 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}
/* Light travelling around the border */
.nav-shell::before {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; padding: 1.5px; pointer-events: none;
  background: conic-gradient(from var(--spin), transparent 0 62%, #0a84ff 72%, #bf5af2 80%, #ff375f 87%, transparent 95%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor; mask-composite: exclude;
  animation: spin-border 7s linear infinite;
}
.site-header.scrolled .nav-shell { height: 56px; background: rgba(255, 255, 255, 0.8); box-shadow: 0 12px 40px rgba(30, 40, 90, 0.16), inset 0 1px 0 #fff; }

.brand { display: flex; align-items: center; gap: 10px; font-weight: 650; color: var(--text); font-size: 1.02rem; letter-spacing: -0.015em; white-space: nowrap; }
.brand:hover { text-decoration: none; }
.logo {
  width: 30px; height: 30px; border-radius: 9px; flex: none;
  background: conic-gradient(from var(--spin), #0a84ff, #bf5af2, #ff375f, #ff9f0a, #30d158, #0a84ff);
  box-shadow: 0 4px 14px rgba(10, 132, 255, 0.4), inset 0 0 0 1px rgba(255, 255, 255, 0.4);
  animation: spin-border 9s linear infinite;
  transition: transform 0.4s cubic-bezier(.3, 1.6, .5, 1);
}
.brand:hover .logo { transform: rotate(-12deg) scale(1.08); }

.nav { display: flex; align-items: center; gap: 2px; margin-left: auto; }
.nav-link {
  font: inherit; font-size: 0.94rem; background: none; border: 0; cursor: pointer; color: var(--text);
  padding: 9px 15px; border-radius: 99px; display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.2s ease, color 0.2s ease;
}
.nav-link:hover, .nav-drop.open > .nav-link { background: rgba(0, 0, 0, 0.055); text-decoration: none; }
.chev { width: 7px; height: 7px; border-right: 1.6px solid currentColor; border-bottom: 1.6px solid currentColor; transform: translateY(-2px) rotate(45deg); transition: transform 0.25s ease; opacity: 0.6; }
.nav-drop.open .chev { transform: translateY(1px) rotate(225deg); }

.nav-drop { position: relative; }
.drop-panel {
  position: absolute; top: calc(100% + 16px); left: 50%; width: 560px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 10px; border-radius: 24px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(28px) saturate(190%); backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid #fff; box-shadow: 0 24px 60px rgba(30, 40, 90, 0.2);
  opacity: 0; visibility: hidden; transform: translate(-50%, 10px) scale(0.98); transform-origin: top center;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
}
.drop-panel::before { content: ""; position: absolute; left: 0; right: 0; top: -18px; height: 18px; } /* hover bridge */
.nav-drop.open .drop-panel { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }
@media (hover: hover) and (min-width: 861px) {
  .nav-drop:hover .drop-panel { opacity: 1; visibility: visible; transform: translate(-50%, 0) scale(1); }
  .nav-drop:hover .chev { transform: translateY(1px) rotate(225deg); }
}
.drop-panel a { display: flex; gap: 12px; padding: 12px 14px; border-radius: 16px; color: var(--text); line-height: 1.35; transition: background 0.2s ease; }
.drop-panel a:hover { background: rgba(0, 113, 227, 0.07); text-decoration: none; }
.drop-panel strong { display: block; font-size: 0.93rem; }
.drop-panel small { display: block; color: var(--muted); font-size: 0.8rem; margin-top: 2px; }
.dd-dot { width: 10px; height: 10px; border-radius: 50%; margin-top: 5px; flex: none; }
.dd-meta { background: #0a84ff; box-shadow: 0 0 10px #0a84ff; }
.dd-google { background: #30d158; box-shadow: 0 0 10px #30d158; }
.dd-tiktok { background: #ff375f; box-shadow: 0 0 10px #ff375f; }
.dd-more-platforms { background: #ff9f0a; box-shadow: 0 0 10px #ff9f0a; }
.dd-shopify { background: #64d2ff; box-shadow: 0 0 10px #64d2ff; }
.dd-fundamentals { background: #bf5af2; box-shadow: 0 0 10px #bf5af2; }
.drop-panel .drop-all { grid-column: 1 / -1; justify-content: center; font-weight: 600; color: var(--accent); font-size: 0.9rem; }

.btn-cta {
  position: relative; overflow: hidden; display: inline-flex; align-items: center; justify-content: center; flex: none;
  padding: 11px 20px; border-radius: 99px; color: #fff; font-weight: 600; font-size: 0.92rem; white-space: nowrap;
  background: linear-gradient(120deg, #0a84ff, #7d5cf7 50%, #d94fd5, #0a84ff); background-size: 300% 100%;
  animation: grad-shift 8s ease infinite;
  box-shadow: 0 6px 20px rgba(10, 132, 255, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-cta::after {
  content: ""; position: absolute; top: 0; left: -70%; width: 45%; height: 100%;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.6), transparent);
  transform: skewX(-20deg); animation: shimmer 3.6s ease-in-out infinite;
}
.btn-cta:hover { transform: translateY(-1px); box-shadow: 0 10px 28px rgba(125, 92, 247, 0.45); text-decoration: none; color: #fff; }
.nav-cta-mobile { display: none; }

.menu-btn { display: none; position: relative; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, 0.055); cursor: pointer; margin-left: auto; }
.menu-btn span { position: absolute; left: 13px; right: 13px; height: 2px; border-radius: 2px; background: var(--text); transition: transform 0.3s ease, top 0.3s ease; }
.menu-btn span:first-child { top: 17px; }
.menu-btn span:last-child { top: 25px; }
.menu-open .menu-btn span:first-child { top: 21px; transform: rotate(45deg); }
.menu-open .menu-btn span:last-child { top: 21px; transform: rotate(-45deg); }

@media (max-width: 860px) {
  .nav-shell > .btn-cta { display: none; }
  .menu-btn { display: block; }
  .nav {
    position: absolute; top: calc(100% + 10px); left: 0; right: 0; margin: 0;
    flex-direction: column; align-items: stretch; gap: 2px; padding: 12px; border-radius: 26px;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(28px) saturate(190%); backdrop-filter: blur(28px) saturate(190%);
    border: 1px solid #fff; box-shadow: 0 24px 60px rgba(30, 40, 90, 0.2);
    opacity: 0; visibility: hidden; transform: translateY(-8px);
    transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s;
    max-height: calc(100vh - 110px); overflow-y: auto;
  }
  .menu-open .nav { opacity: 1; visibility: visible; transform: none; }
  .nav-link { width: 100%; justify-content: space-between; padding: 13px 16px; font-size: 1rem; }
  .drop-panel {
    position: static; width: auto; grid-template-columns: 1fr; padding: 0 0 6px 8px; transform: none;
    background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none;
    display: none; opacity: 1; visibility: visible;
  }
  .nav-drop.open .drop-panel { display: grid; transform: none; }
  .drop-panel::before { display: none; }
  .nav-cta-mobile { display: flex; margin-top: 8px; padding: 14px; }
}
@media (max-width: 420px) { .brand-name { font-size: 0.95rem; } }

/* ===================== Motion ===================== */
body { overflow-x: clip; }
.hero h1 { background-size: 220% auto; animation: text-shift 9s ease-in-out infinite alternate; }
.orb { animation: orb-breathe 6s ease-in-out infinite; }
.chip-1 { animation: bob 4.5s ease-in-out infinite; }
.chip-2 { animation: bob 5s ease-in-out infinite 1.2s; }
.chip-3 { animation: bob 5.5s ease-in-out infinite 0.6s; }
.dot.warn { animation: pulse 1.8s ease-in-out infinite; }

.reveal { opacity: 0; transform: perspective(1000px) rotateX(18deg) translateY(46px) scale(0.96); transform-origin: 50% 100%; transition: opacity 0.8s ease, transform 0.9s cubic-bezier(.2, .7, .2, 1); }
.reveal.in { opacity: 1; transform: none; }

@keyframes spin-border { to { --spin: 360deg; } }
@keyframes grad-shift { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }
@keyframes shimmer { 0%, 55% { left: -70%; } 100% { left: 130%; } }
@keyframes drift { 0% { transform: translate3d(0, 0, 0) scale(1); } 50% { transform: translate3d(-3%, 2%, 0) scale(1.06); } 100% { transform: translate3d(2%, -2%, 0) scale(1.03); } }
@keyframes text-shift { from { background-position: 0% 50%; } to { background-position: 100% 50%; } }
@keyframes orb-breathe { 0%, 100% { transform: translate(-50%, -50%) scale(1); } 50% { transform: translate(-50%, -50%) scale(1.08); } }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255, 159, 10, 0.6); } 50% { box-shadow: 0 0 0 6px rgba(255, 159, 10, 0); } }

/* ===================== Services & contact ===================== */
.page-body.wide { max-width: var(--maxw); }
.page-intro { font-size: 1.15rem; color: var(--muted); max-width: 720px; }
.svc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 18px; margin: 28px 0 8px; }
.svc {
  position: relative; display: flex; flex-direction: column; padding: 24px; border-radius: 22px;
  background: rgba(255, 255, 255, 0.7); border: 1px solid #fff; box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.svc:hover { transform: translateY(-4px); box-shadow: var(--shadow-hover); }
.svc .svc-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 1.1rem; margin-bottom: 14px; box-shadow: 0 6px 16px rgba(30, 40, 90, 0.18); }
.svc h3 { margin: 0 0 6px !important; font-size: 1.15rem; }
.svc p { color: var(--muted); font-size: 0.96rem; }
.svc ul { padding-left: 18px; font-size: 0.94rem; margin-bottom: 18px !important; }
.svc .svc-link { margin-top: auto; font-weight: 600; }
.svc.featured { background: linear-gradient(160deg, rgba(10, 132, 255, 0.12), rgba(191, 90, 242, 0.12)), rgba(255, 255, 255, 0.8); }
.svc .ribbon { position: absolute; top: 18px; right: 18px; font-size: 0.72rem; font-weight: 700; color: #fff; padding: 4px 10px; border-radius: 99px; background: linear-gradient(120deg, #0a84ff, #bf5af2); }
.i-blue { background: linear-gradient(135deg, #0a84ff, #5e5ce6); }
.i-green { background: linear-gradient(135deg, #30d158, #0fb5a0); }
.i-pink { background: linear-gradient(135deg, #ff375f, #ff9f0a); }
.i-purple { background: linear-gradient(135deg, #bf5af2, #5e5ce6); }
.steps { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; counter-reset: step; margin: 20px 0; }
.step { padding: 20px; border-radius: 20px; background: rgba(255, 255, 255, 0.6); border: 1px solid #fff; }
.step::before { counter-increment: step; content: counter(step); display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; margin-bottom: 10px; font-weight: 700; color: #fff; background: linear-gradient(135deg, #0a84ff, #bf5af2); }
.step h3 { margin: 0 0 6px !important; font-size: 1.05rem; }
.step p { margin: 0 !important; color: var(--muted); font-size: 0.95rem; }
.cta-band { margin-top: 32px; padding: 28px; border-radius: 24px; text-align: center; background: linear-gradient(120deg, rgba(10, 132, 255, 0.14), rgba(191, 90, 242, 0.14), rgba(255, 55, 95, 0.1)); border: 1px solid #fff; }
.cta-band h2 { margin-top: 0 !important; }
.cta-band .btn-cta { padding: 14px 28px; font-size: 1rem; }

.contact-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: start; }
@media (max-width: 860px) { .contact-grid { grid-template-columns: 1fr; } }
.cform { display: grid; gap: 14px; position: relative; }
.cform .two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 560px) { .cform .two { grid-template-columns: 1fr; } }
.cform label { display: grid; gap: 6px; font-weight: 600; font-size: 0.92rem; }
.cform label span.opt { font-weight: 400; color: var(--muted); }
.cform input, .cform select, .cform textarea {
  font: inherit; font-size: 1rem; color: var(--text); width: 100%; padding: 13px 16px; border-radius: 14px;
  border: 1px solid rgba(0, 0, 0, 0.1); background: rgba(255, 255, 255, 0.85);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.cform textarea { min-height: 150px; resize: vertical; }
.cform input:focus, .cform select:focus, .cform textarea:focus { outline: none; border-color: rgba(0, 113, 227, 0.55); box-shadow: 0 0 0 4px rgba(0, 113, 227, 0.14); }
.cform .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.field-error { color: #d70015; font-size: 0.85rem; font-weight: 500; }
.field-error:empty { display: none; }
.cform button[type=submit] { border: 0; cursor: pointer; justify-self: start; padding: 14px 30px; font: inherit; font-weight: 600; }
.cform button.loading { opacity: 0.7; pointer-events: none; }
.form-status { margin: 0; font-weight: 500; }
.form-status:empty { display: none; }
.form-status.ok { color: #11622b; background: rgba(48, 209, 88, 0.12); border: 1px solid rgba(48, 209, 88, 0.35); padding: 12px 16px; border-radius: 14px; }
.form-status.err { color: #b0001a; }
.side-card { padding: 22px; border-radius: 22px; background: rgba(255, 255, 255, 0.6); border: 1px solid #fff; margin-bottom: 16px; }
.side-card h3 { margin-top: 0 !important; }
.side-card ul { padding-left: 18px; margin-bottom: 0 !important; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; }
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* Phones: frosted blur on many large panels is expensive, so use near-opaque surfaces instead. */
@media (max-width: 760px) {
  .card, .cat-tile, .toc, .post-foot, .site-footer, .page-body, .post, .search input {
    -webkit-backdrop-filter: none; backdrop-filter: none; background: rgba(255, 255, 255, 0.84);
  }
}

/* ===================== Pixel Doctor (home) ===================== */
.doctor {
  position: relative; margin: 0 0 52px; padding: 30px; border-radius: 28px; overflow: hidden;
  background: linear-gradient(135deg, rgba(10, 132, 255, 0.1), rgba(191, 90, 242, 0.1) 55%, rgba(255, 55, 95, 0.08)), var(--glass-strong);
  border: 1px solid #fff; box-shadow: var(--shadow-hover), inset 0 1px 0 #fff;
}
.dx-head h2 { margin: 10px 0 4px; font-size: clamp(1.5rem, 3vw, 2rem); letter-spacing: -0.02em; }
.dx-head p { margin: 0 0 18px; }
.dx-badge {
  display: inline-flex; align-items: center; gap: 8px; padding: 5px 12px; border-radius: 99px;
  font-size: 0.78rem; font-weight: 700; color: #fff; background: linear-gradient(120deg, #0a84ff, #bf5af2);
}
.dx-badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: #fff; animation: pulse-w 1.6s ease-in-out infinite; }
.dx-form { display: grid; gap: 14px; }
.dx-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.dx-form legend { display: flex; align-items: center; gap: 8px; padding: 0; margin-bottom: 10px; font-weight: 600; font-size: 0.95rem; }
.dx-num { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; font-size: 0.78rem; color: #fff; background: var(--text); }
.dx-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dx-chip { position: relative; cursor: pointer; }
.dx-chip input { position: absolute; opacity: 0; pointer-events: none; }
.dx-chip span {
  display: block; padding: 9px 16px; border-radius: 99px; font-size: 0.92rem; font-weight: 500;
  background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(0, 0, 0, 0.08);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.dx-chip:hover span { transform: translateY(-2px); box-shadow: var(--shadow); }
.dx-chip input:checked + span { color: #fff; border-color: transparent; background: linear-gradient(120deg, #0a84ff, #5e5ce6); box-shadow: 0 6px 18px rgba(10, 132, 255, 0.35); }
.dx-chip input:focus-visible + span { outline: 3px solid rgba(0, 113, 227, 0.45); outline-offset: 2px; }
.dx-results { margin-top: 20px; }
.dx-hint { margin: 0 0 12px; font-weight: 500; }
.dx-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.dx-item {
  display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 18px; color: var(--text);
  background: rgba(255, 255, 255, 0.85); border: 1px solid #fff; box-shadow: var(--shadow);
  animation: dx-in 0.45s cubic-bezier(.2, .7, .2, 1) backwards;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.dx-item[hidden] { display: none; }
.dx-item:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow-hover); }
.dx-item img { width: 84px; height: 56px; object-fit: cover; border-radius: 12px; flex: none; }
.dx-text { display: grid; gap: 2px; min-width: 0; }
.dx-text b { font-size: 0.95rem; line-height: 1.3; }
.dx-text small { color: var(--muted); font-size: 0.8rem; }
.dx-go { margin-left: auto; font-size: 1.2rem; color: var(--accent); transition: transform 0.2s ease; }
.dx-item:hover .dx-go { transform: translateX(4px); }
.dx-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin: 18px 0 0; font-weight: 500; }
.dx-cta[hidden] { display: none; }
@media (max-width: 560px) { .doctor { padding: 22px 16px; } }
@keyframes dx-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } to { opacity: 1; transform: none; } }
@keyframes pulse-w { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }

/* ===================== 3D tilt on cards (site.js adds .tilt on fine pointers) ===================== */
.tilt { position: relative; }
.tilt.tilting {
  transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(-4px);
  transition: transform 0.08s linear, box-shadow 0.25s ease;
}
.tilt::after {
  content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; opacity: 0;
  background: radial-gradient(420px circle at var(--gx, 50%) var(--gy, 50%), rgba(255, 255, 255, 0.55), transparent 45%);
  transition: opacity 0.3s ease;
}
.tilt.tilting::after { opacity: 1; }

/* ===================== CSS 3D cubes (category tiles, Pixel Doctor) ===================== */
.cube3d { --s: 26px; display: block; width: var(--s); height: var(--s); margin: 2px 0 12px; perspective: calc(var(--s) * 6); }
.cube3d-in { position: relative; display: block; width: 100%; height: 100%; transform-style: preserve-3d; animation: cube-spin 9s linear infinite; }
.cube3d-in i {
  /* Solid faces shaded with a gradient layer (--shade). No glow shadows or filters: on 3D-transformed
     faces those get rasterised soft and make the cube look blurry. */
  position: absolute; inset: 0; border-radius: calc(var(--s) * 0.16);
  background: linear-gradient(var(--shade, transparent), var(--shade, transparent)), linear-gradient(135deg, rgba(255, 255, 255, 0.5), rgba(255, 255, 255, 0) 55%), var(--dot, var(--accent));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.45);
  backface-visibility: hidden;
}
.cube3d-in i:nth-child(1) { transform: translateZ(calc(var(--s) / 2)); }
.cube3d-in i:nth-child(2) { transform: rotateY(180deg) translateZ(calc(var(--s) / 2)); --shade: rgba(0, 0, 0, 0.3); }
.cube3d-in i:nth-child(3) { transform: rotateY(90deg) translateZ(calc(var(--s) / 2)); --shade: rgba(0, 0, 0, 0.16); }
.cube3d-in i:nth-child(4) { transform: rotateY(-90deg) translateZ(calc(var(--s) / 2)); --shade: rgba(0, 0, 0, 0.16); }
.cube3d-in i:nth-child(5) { transform: rotateX(90deg) translateZ(calc(var(--s) / 2)); --shade: rgba(255, 255, 255, 0.22); }
.cube3d-in i:nth-child(6) { transform: rotateX(-90deg) translateZ(calc(var(--s) / 2)); --shade: rgba(0, 0, 0, 0.4); }
.cat-tile:nth-child(2n) .cube3d-in { animation-direction: reverse; animation-duration: 11s; }
.cat-tile:hover .cube3d-in { animation-duration: 2.4s; }
@keyframes cube-spin { from { transform: rotateX(-24deg) rotateY(0deg); } to { transform: rotateX(-24deg) rotateY(360deg); } }

.dx-deco { position: absolute; top: 22px; right: 26px; width: 170px; height: 120px; pointer-events: none; }
.dx-deco .cube3d { position: absolute; margin: 0; }
.dx-deco .c1 { --s: 54px; --dot: #0a84ff; right: 18px; top: 8px; animation: bob 5s ease-in-out infinite; }
.dx-deco .c2 { --s: 30px; --dot: #bf5af2; right: 104px; top: 46px; animation: bob 4.2s ease-in-out infinite 0.8s; }
.dx-deco .c3 { --s: 20px; --dot: #ff375f; right: 2px; top: 86px; animation: bob 3.8s ease-in-out infinite 0.3s; }
.dx-deco .c2 .cube3d-in { animation-duration: 7s; animation-direction: reverse; }
.dx-deco .c3 .cube3d-in { animation-duration: 5s; }
.doctor > :not(.dx-deco) { position: relative; }
@media (max-width: 700px) { .dx-deco { transform: scale(0.6); transform-origin: top right; top: 14px; right: 12px; } }

/* 3D extruded section headings */
.section-title, .dx-head h2 {
  text-shadow: 0 1px 0 #e3e5ee, 0 2px 0 #d7dae6, 0 3px 0 #ccd0df, 0 4px 0 #c2c6d7, 0 8px 14px rgba(30, 40, 90, 0.22);
}

/* Scroll-linked depth: site.js sets --sx/--sy from each card's position in the viewport. */
.scroll3d:not(.reveal):not(.tilting) {
  transform: perspective(1100px) rotateX(var(--sx, 0deg)) rotateY(var(--sy, 0deg));
  transition: transform 0.25s ease-out, box-shadow 0.25s ease, background 0.25s ease;
}
