
section[id] { scroll-margin-top: 110px; }
nav .me { color: inherit; text-decoration: none; }
.books-inner { display: block; }
.books-inner > div { max-width: 760px; }
.book-gallery { max-width: 1200px; margin: 48px auto 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 36px; }
.real-book { margin: 0; padding: 24px; background: #fff; border: 1px solid var(--border); border-radius: 16px; }
.real-book img { display: block; width: 100%; height: 300px; object-fit: contain; filter: drop-shadow(4px 8px 8px #0002); }
.real-book figcaption { margin-top: 20px; font-size: 15px; line-height: 1.4; text-align: center; }
@media(max-width: 900px) {
 nav { max-width: calc(100% - 24px); flex-wrap: wrap; justify-content: center; gap: 8px; }
 nav ul { display: flex; order: 3; width: 100%; overflow-x: auto; gap: 16px; padding: 8px; }
 nav ul li { flex-shrink: 0; }
 .book-gallery { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 16px; }
 .real-book { padding: 14px; }
 .real-book img { height: 230px; }
}
@media(max-width: 500px) { .real-book img { height: 185px; } .real-book figcaption { font-size: 12px; } }

.hero { max-width: 1760px; padding-inline: clamp(24px, 3vw, 56px); }
.hero-text .lead { max-width: 650px; }
.tech-icon { object-fit: contain; }
.tech-mark { width: 24px; height: 24px; display: inline-flex; align-items: center; justify-content: center; font: 600 11px monospace; border: 1px solid #ffffff40; border-radius: 5px; color: #ffd84d; }
@media (max-width: 900px) { .hero { padding-inline: 20px; } }

/* Optical sizing: wide wordmarks need more space than square symbols. */
.tech-icon { width: 22px; height: 22px; }
.tech-icon[src$="woocommerce.svg"] { width: 58px; height: 32px; }
.tech-icon[src$="gsap.svg"],
.tech-icon[src$="gulp.svg"],
.tech-icon[src$="mysql.svg"],
.tech-icon[src$="php.svg"] { width: 42px; height: 32px; }
.tech-mark { width: 24px; height: 24px; font-size: 11px; flex-shrink: 0; }


nav[aria-label="Main navigation"] { width: min(980px, calc(100% - 40px)); }
nav[aria-label="Main navigation"] ul { flex: 1; justify-content: space-evenly; }
nav[aria-label="Main navigation"] ul a { display: block; white-space: nowrap; }
nav[aria-label="Main navigation"] .me,
nav[aria-label="Main navigation"] .say-hi { flex-shrink: 0; }
@media (max-width: 900px) {
  nav[aria-label="Main navigation"] { width: calc(100% - 24px); flex-wrap: nowrap; justify-content: space-between; }
  nav[aria-label="Main navigation"] ul { display: none; }
}

/* Client globe */
.clients {
  max-width: 1760px;
  margin: 0 auto;
  padding: 96px clamp(24px, 5vw, 80px);
  display: grid;
  grid-template-columns: minmax(0, .8fr) minmax(420px, 1.2fr);
  align-items: center;
  gap: clamp(32px, 7vw, 120px);
  overflow: hidden;
}
.clients-copy h2 {
  font-family: 'Instrument Serif', serif;
  font-size: clamp(52px, 6vw, 96px);
  font-weight: 400;
  line-height: .92;
  letter-spacing: -.04em;
}
.clients-copy h2 em { color: var(--accent); font-weight: 400; }
.clients-copy > p { max-width: 540px; margin: 28px 0 36px; color: var(--ink-soft); font-size: 17px; line-height: 1.7; }
.client-countries { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 540px; }
.client-countries button {
  appearance: none;
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 100px;
  background: transparent;
  color: var(--ink);
  font: 600 13px/1.2 'Inter', sans-serif;
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s;
}
.client-countries button span { color: var(--muted); font: 10px 'JetBrains Mono', monospace; }
.client-countries button:hover,
.client-countries button:focus-visible,
.client-countries button.is-active { border-color: var(--accent); background: var(--accent-soft); transform: translateY(-2px); outline: none; }
.globe-wrap { position: relative; width: min(100%, 680px); justify-self: center; aspect-ratio: 1; }
#client-globe { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
#client-globe:active { cursor: grabbing; }
#client-globe:focus-visible { outline: 2px solid var(--accent); outline-offset: 5px; border-radius: 50%; }
.globe-tooltip {
  position: absolute;
  z-index: 2;
  padding: 8px 12px;
  border-radius: 100px;
  background: var(--ink);
  color: var(--bg);
  font: 11px 'JetBrains Mono', monospace;
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -130%);
  transition: opacity .15s;
  white-space: nowrap;
}
.globe-tooltip.is-visible { opacity: 1; }
.globe-hint { position: absolute; left: 50%; bottom: 5%; transform: translateX(-50%); color: var(--muted); font: 10px 'JetBrains Mono', monospace; text-transform: uppercase; letter-spacing: .14em; white-space: nowrap; }

@media (max-width: 900px) {
  .clients { grid-template-columns: 1fr; padding: 48px 20px; gap: 20px; text-align: center; }
  .clients-copy > p, .client-countries { margin-left: auto; margin-right: auto; }
  .globe-wrap { width: min(100%, 520px); }
}
@media (max-width: 500px) {
  nav[aria-label="Main navigation"] { top: 10px; }
  nav[aria-label="Main navigation"] .me { font-size: 14px; }
  nav[aria-label="Main navigation"] .say-hi { padding: 9px 13px; }
  .clients { padding-block: 36px; }
  .clients-copy h2 { font-size: clamp(46px, 15vw, 64px); }
  .clients-copy > p { margin-block: 20px 24px; font-size: 15px; }
  .client-countries { grid-template-columns: 1fr 1fr; gap: 6px; }
  .client-countries button { padding: 11px 12px; gap: 7px; font-size: 11px; }
  .globe-wrap { width: calc(100% + 20px); margin-inline: -10px; }
}

/* Larger marks only for the requested hard-to-read tools. */
.tool-group-quality .tech-mark,
.tech-rankmath .tech-mark { width: 30px; height: 30px; font-size: 20px; }
.tech-icon[src$="woocommerce.svg"] { width: 82px; height: 36px; }

.woo-mark { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 27px; flex-shrink: 0; border-radius: 7px; background: #f4d477; color: #211f1b; font: 800 17px/1 Arial, sans-serif; letter-spacing: -1px; }

/* Keep the stacked portrait secondary to the introduction. */
@media (max-width: 1100px) {
  .hero-portrait-frame { width: min(100%, 280px); }
  .hero-main { gap: 28px; }
}
@media (max-width: 600px) {
  .hero-portrait-frame { width: min(100%, 210px); }
  .hero-main { gap: 20px; }
}

/* Center the introduction on compact desktop, tablet and mobile screens. */
@media (max-width: 1280px) {
  .hero-intro { justify-content: center; text-align: center; }
  .hero-text { text-align: center; align-items: center; }
  .hero-name, .hero-cta { justify-content: center; }
}

/* Compact section rhythm on smaller screens. */
@media (max-width: 1280px) {
  .work, .services, .about, .stack, .books-sec, .process, .final { padding-block: 56px; }
  .work-header { margin-bottom: 32px; }
  .stack-quote { margin-top: 32px; }
  .book-gallery { margin-top: 32px; }
}
@media (max-width: 900px) {
  .work, .services, .about, .stack, .books-sec, .process, .final { padding-block: 36px; }
  .hero { padding-bottom: 32px; }
  .work-header { margin-bottom: 24px; }
  .project-controls { margin-top: 16px; }
  .about-grid, .books-inner { gap: 24px; }
  .services-intro { margin-bottom: 24px; }
  .stack-inner h2 { margin-bottom: 28px; }
}
@media (max-width: 600px) {
  .work, .services, .about, .stack, .books-sec, .process, .final { padding-block: 28px; }
  .work-header { gap: 12px; }
  .stack-quote, .book-gallery { margin-top: 24px; }
}

.niches { max-width: 1280px; margin: auto; padding: 80px 40px; }
.niches h2 { font-family: 'Instrument Serif', serif; font-size: clamp(38px,5vw,68px); line-height: 1.05; font-weight: 400; letter-spacing: -.03em; margin-bottom: 24px; }
.niches h2 em { color: var(--accent); }
.niches-intro { max-width: 680px; line-height: 1.7; color: var(--ink-soft); margin-bottom: 32px; }
.niche-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 16px; }
.niche-card { display: flex; flex-direction: column; padding: 24px; background: white; border: 1px solid var(--border); border-radius: 20px; }
.niche-card:first-child { background: var(--bg-warm); border-color: var(--accent); }
.niche-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 24px; }
.niche-icon { font-size: 28px; color: var(--accent); }
.niche-status { font: 10px monospace; color: var(--ink-soft); }
.niche-card h3 { font-family: 'Instrument Serif',serif; font-size: 30px; font-weight: 400; margin-bottom: 12px; }
.niche-card p { font-size: 14px; line-height: 1.6; color: var(--ink-soft); margin-bottom: 24px; }
.niche-card .order-btn { margin-top: auto; font-size: 13px; }
@media(max-width:1280px) { .niches { padding-block: 56px; } }
@media(max-width:900px) { .niches { padding: 36px 20px; } .niche-grid { grid-template-columns: repeat(2,minmax(0,1fr)); } }
@media(max-width:600px) { .niches { padding-block: 28px; } .niche-grid { grid-template-columns: 1fr; } }
