/*
Theme Name: Ketch
Theme URI: https://ketch.sg
Author: HeyLead
Description: Editorial, premium WordPress theme for Ketch Locksmiths Singapore. Black / white / crimson, Helvetica + Instrument Serif, static-first build.
Version: 1.2.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 7.4
License: GPL v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: ketch
*/

@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap');

:root {
  --ink: #0E0E0E;
  --ink-2: #1a1a1a;
  --ink-soft: #2c2c2c;
  --paper: #F6F4F0;
  --paper-2: #EDEAE3;
  --paper-3: #E2DED5;
  --line: rgba(14, 14, 14, 0.14);
  --line-strong: rgba(14, 14, 14, 0.28);
  --muted: #6b6964;
  --muted-2: #8a8884;

  --red: #B11226;
  --red-deep: #8a0e1d;
  --red-ink: #5a0a13;

  --serif: "Instrument Serif", "Times New Roman", Times, serif;
  --sans: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, "SF Mono", Menlo, monospace;

  --gutter: 32px;
  --container: 1280px;
  --radius: 6px;
  --radius-lg: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; }

.k-eyebrow {
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}
.k-eyebrow .dot {
  display: inline-block; width: 6px; height: 6px; border-radius: 50%;
  background: var(--red); margin-right: 10px; transform: translateY(-2px);
}

.k-display {
  font-family: var(--serif);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 0.98;
  margin: 0;
}
.k-display em { font-style: italic; color: var(--red); }

.k-h1 { font-family: var(--serif); font-weight: 400; font-size: clamp(48px, 6vw, 92px); line-height: 1.0; letter-spacing: -0.02em; margin: 0; }
.k-h2 { font-family: var(--serif); font-weight: 400; font-size: clamp(36px, 4.4vw, 64px); line-height: 1.05; letter-spacing: -0.015em; margin: 0; }
.k-h3 { font-family: var(--serif); font-weight: 400; font-size: clamp(24px, 2.4vw, 36px); line-height: 1.1; letter-spacing: -0.01em; margin: 0; }
.k-h4 { font-family: var(--sans); font-weight: 500; font-size: 17px; line-height: 1.3; letter-spacing: -0.005em; margin: 0; }

.k-lede { font-family: var(--sans); font-size: 19px; line-height: 1.5; color: var(--ink-soft); font-weight: 400; }
.k-body { font-family: var(--sans); font-size: 15.5px; line-height: 1.6; color: var(--ink-soft); }
.k-small { font-family: var(--sans); font-size: 13px; line-height: 1.5; color: var(--muted); }
.k-mono { font-family: var(--mono); font-size: 11px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--muted); }

.k-container { max-width: var(--container); margin: 0 auto; padding: 0 var(--gutter); }
.k-section { padding: 96px 0; }
.k-section--lg { padding: 140px 0; }
.k-section--sm { padding: 64px 0; }

.k-rule { height: 1px; background: var(--line); border: 0; margin: 0; }
.k-rule-strong { height: 1px; background: var(--ink); border: 0; margin: 0; opacity: 0.85; }

.k-utility {
  background: var(--ink);
  color: #d9d6cf;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.k-utility-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 10px var(--gutter);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}
.k-utility .k-pulse {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--red); margin-right: 8px;
  box-shadow: 0 0 0 0 rgba(177, 18, 38, 0.6);
  animation: pulse 2s infinite;
}
@keyframes pulse {
  0% { box-shadow: 0 0 0 0 rgba(177, 18, 38, 0.6); }
  70% { box-shadow: 0 0 0 8px rgba(177, 18, 38, 0); }
  100% { box-shadow: 0 0 0 0 rgba(177, 18, 38, 0); }
}
.k-utility a { color: #fff; }
.k-utility .right { display: flex; gap: 24px; align-items: center; }

.k-nav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(246, 244, 240, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.k-nav-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
}
.k-logo { display: flex; align-items: baseline; gap: 8px; }
.k-logo--image { display: inline-flex; align-items: center; padding: 4px 0; }
.k-logo--image img {
  display: block;
  height: 53px;
  width: auto;
  max-width: 240px;
  object-fit: contain;
  border-radius: 3px;
  transition: opacity 0.18s ease;
}
.k-logo--image:hover img { opacity: 0.85; }
@media (max-width: 860px) {
  .k-logo--image img { height: 43px; max-width: 192px; }
}
.k-logo .mark {
  font-family: var(--serif); font-size: 30px; font-weight: 400;
  letter-spacing: -0.02em; line-height: 1;
}
.k-logo .mark::after {
  content: ""; display: inline-block; width: 6px; height: 6px;
  background: var(--red); margin-left: 4px; transform: translateY(-14px);
}
.k-logo .sub {
  font-size: 10px; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--muted);
}
.k-navlinks {
  display: flex; gap: 28px; justify-content: center;
  font-size: 14px; letter-spacing: 0.02em;
  font-weight: 500;
}
.k-navlinks a {
  position: relative; padding: 8px 2px;
  color: var(--ink-soft);
  transition: color 0.2s ease;
}
.k-navlinks a::after {
  content: ""; position: absolute; left: 2px; right: 2px; bottom: 2px;
  height: 2px; background: var(--red);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.k-navlinks a:hover { color: var(--ink); }
.k-navlinks a:hover::after { transform: scaleX(1); }
.k-navlinks a.active { color: var(--ink); }
.k-navlinks a.active::after { transform: scaleX(1); }
.k-nav-cta { display: flex; gap: 12px; justify-content: flex-end; align-items: center; }

/* Nav dropdown (Services) */
.k-navitem { position: relative; display: inline-flex; align-items: center; }
.k-navitem--has-children > a { display: inline-flex; align-items: center; gap: 6px; }
.k-navitem--has-children > a .caret {
  width: 10px; height: 7px;
  display: inline-block;
  transition: transform 0.2s ease;
  color: var(--muted);
}
.k-navitem--has-children:hover > a .caret,
.k-navitem--has-children:focus-within > a .caret { transform: rotate(180deg); color: var(--ink); }

.k-navitem-toggle { display: none; }

.k-navsub {
  position: absolute; top: calc(100% + 6px); left: -14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 8px 0;
  min-width: 240px;
  box-shadow: 0 18px 36px -12px rgba(14,14,14,0.22);
  opacity: 0; visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0s linear 0.2s;
  z-index: 60;
  pointer-events: none;
}
.k-navitem--has-children:hover .k-navsub,
.k-navitem--has-children:focus-within .k-navsub,
.k-navitem--has-children.is-open .k-navsub {
  opacity: 1; visibility: visible; transform: translateY(0);
  transition-delay: 0s;
  pointer-events: auto;
}
/* Hover bridge so the gap between trigger and panel doesn't close it */
.k-navitem--has-children::after {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 14px;
}
.k-navsub a {
  display: block;
  padding: 11px 22px;
  font-size: 14px; letter-spacing: 0.01em;
  font-weight: 400;
  color: var(--ink-soft);
  border-left: 2px solid transparent;
  white-space: nowrap;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.k-navsub a::after { display: none; }
.k-navsub a:hover { color: var(--ink); background: var(--paper-2); border-left-color: var(--line-strong); }
.k-navsub a.active { color: var(--red); border-left-color: var(--red); background: var(--paper-2); font-weight: 500; }

.k-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 22px;
  font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  font-weight: 500;
  border: 1px solid var(--ink);
  background: var(--ink); color: var(--paper);
  border-radius: var(--radius);
  transition: all 0.2s ease;
  cursor: pointer;
}
.k-btn:hover { background: var(--red); border-color: var(--red); }
.k-btn--ghost { background: transparent; color: var(--ink); }
.k-btn--ghost:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.k-btn--red { background: var(--red); border-color: var(--red); color: #fff; }
.k-btn--red:hover { background: var(--red-deep); border-color: var(--red-deep); }
.k-btn--lg { padding: 18px 28px; font-size: 13px; }
.k-btn .arrow { transition: transform 0.2s ease; }
.k-btn:hover .arrow { transform: translateX(3px); }

.k-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--ink); padding-bottom: 2px;
  border-bottom: 1px solid var(--ink);
  font-weight: 500;
}
.k-link:hover { color: var(--red); border-color: var(--red); }

.k-ph {
  position: relative;
  background:
    repeating-linear-gradient(135deg,
      rgba(14,14,14,0.04) 0 1px,
      transparent 1px 14px),
    var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-2);
  font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  overflow: hidden;
}
.k-ph--dark {
  background:
    repeating-linear-gradient(135deg,
      rgba(255,255,255,0.04) 0 1px,
      transparent 1px 14px),
    #1a1a1a;
  color: rgba(255,255,255,0.45);
  border-color: rgba(255,255,255,0.1);
}
.k-ph .label {
  padding: 6px 10px;
  border: 1px solid currentColor;
  white-space: nowrap;
}

.k-footer {
  background: var(--ink);
  color: #d9d6cf;
  padding: 80px 0 32px;
}
.k-footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 64px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.k-footer h5 {
  font-family: var(--sans); font-size: 11px; font-weight: 500;
  letter-spacing: 0.18em; text-transform: uppercase;
  color: rgba(255,255,255,0.55); margin: 0 0 20px;
}
.k-footer ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 12px; font-size: 14px; }
.k-footer ul a { color: #fff; }
.k-footer ul a:hover { color: var(--red); }
.k-footer .brand-block {
  font-family: var(--serif); font-size: 38px; line-height: 1; letter-spacing: -0.02em;
  color: #fff;
}
.k-footer .brand-block::after {
  content: ""; display: inline-block; width: 8px; height: 8px; background: var(--red);
  margin-left: 4px; transform: translateY(-22px);
}
.k-footer-meta {
  display: flex; justify-content: space-between; align-items: center;
  padding-top: 32px; font-size: 12px; color: rgba(255,255,255,0.5);
  letter-spacing: 0.04em;
}
.k-footer-meta .legal { display: flex; gap: 24px; }
.k-footer-meta a { color: inherit; }
.k-footer-meta a:hover { color: #fff; }
.k-footer-meta-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  text-align: right;
}
.k-footer-credit {
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.45);
}
.k-footer-credit a {
  color: inherit;
  border-bottom: 1px solid transparent;
  transition: color 0.18s ease, border-color 0.18s ease;
}
.k-footer-credit a:hover {
  color: #fff;
  border-bottom-color: rgba(255,255,255,0.4);
}

.k-hero {
  position: relative;
  padding: 80px 0 96px;
  border-bottom: 1px solid var(--line);
}
.k-hero-grid {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 64px;
  align-items: end;
}

.k-service-card {
  display: flex; flex-direction: column;
  border-top: 1px solid var(--ink);
  padding: 32px 0 40px;
  position: relative;
  cursor: pointer;
}
.k-service-card .num {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.1em;
  color: var(--muted); margin-bottom: 28px;
}
.k-service-card .title {
  font-family: var(--serif); font-size: 30px; line-height: 1.1;
  letter-spacing: -0.01em; margin: 0 0 14px;
}
.k-service-card .desc { font-size: 14.5px; color: var(--ink-soft); line-height: 1.55; max-width: 38ch; }
.k-service-card .more {
  margin-top: 24px; display: inline-flex; align-items: center; gap: 8px;
  font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink);
}
.k-service-card:hover .title { color: var(--red); }
.k-service-card:hover .more { color: var(--red); }
.k-service-card--static { cursor: default; }
.k-service-card--static:hover .title { color: inherit; }

.k-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--ink-soft); background: transparent;
  transition: all 0.18s ease;
}
button.k-pill, a.k-pill { cursor: pointer; }
button.k-pill:hover, a.k-pill:hover { border-color: var(--ink); color: var(--ink); }
button.k-pill.k-pill--red:hover, a.k-pill.k-pill--red:hover { background: var(--red-deep); border-color: var(--red-deep); color: #fff; }
.k-pill--solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.k-pill--red { background: var(--red); color: #fff; border-color: var(--red); }

.k-stat .num { font-family: var(--serif); font-size: clamp(48px, 5vw, 72px); line-height: 1; letter-spacing: -0.02em; }
.k-stat .lbl { font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-top: 12px; }

/* Big-stats row (about page): 4 across desktop, 2x2 on mobile */
.k-bigstats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.k-bigstats__cell {
  padding: 56px 24px;
  border-left: 1px solid var(--line);
}
.k-bigstats__cell:first-child { border-left: 0; }
@media (max-width: 860px) {
  .k-bigstats { grid-template-columns: repeat(2, 1fr); }
  .k-bigstats__cell { padding: 32px 16px; min-width: 0; }
  /* Reset all borders, then redraw for the 2x2 */
  .k-bigstats__cell { border-left: 0; }
  .k-bigstats__cell:nth-child(even) { border-left: 1px solid var(--line); }
  .k-bigstats__cell:nth-child(n+3)  { border-top: 1px solid var(--line); }
  .k-bigstats .k-stat .num { font-size: clamp(36px, 8vw, 52px); }
}

.k-quote {
  font-family: var(--serif); font-size: clamp(28px, 3vw, 44px); line-height: 1.2;
  letter-spacing: -0.01em; color: var(--ink);
}
.k-quote em { color: var(--red); }

.k-numlist { list-style: none; padding: 0; margin: 0; }
.k-numlist li {
  display: grid; grid-template-columns: 36px 1fr; gap: 16px;
  padding: 18px 0; border-top: 1px solid var(--line);
  font-size: 15px;
}
.k-numlist li:last-child { border-bottom: 1px solid var(--line); }
.k-numlist .n { font-family: var(--mono); font-size: 11px; color: var(--muted); padding-top: 4px; }

.k-input, .k-textarea, .k-select {
  width: 100%;
  background: transparent;
  border: 0; border-bottom: 1px solid var(--line-strong);
  padding: 14px 0;
  font-family: var(--sans); font-size: 16px;
  color: var(--ink);
  outline: none;
  border-radius: 0;
}
.k-input:focus, .k-textarea:focus, .k-select:focus { border-bottom-color: var(--ink); }
.k-label { font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.k-textarea { resize: none; min-height: 120px; }

.k-tags { display: flex; flex-wrap: wrap; gap: 8px; }

.k-table { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.k-table th, .k-table td { text-align: left; padding: 18px 16px; border-bottom: 1px solid var(--line); vertical-align: top; }
.k-table th { font-family: var(--mono); font-size: 11px; font-weight: 500; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); padding-bottom: 12px; }
.k-table tr:hover td { background: rgba(14,14,14,0.02); }
.k-table .price { font-family: var(--serif); font-size: 22px; }
.k-table .price em { color: var(--red); font-style: normal; }

.k-trust {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 28px 0;
  display: flex; justify-content: space-between; align-items: center; gap: 32px;
  flex-wrap: wrap;
}
.k-trust .item { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-soft); }

/* Bento hero (home + sub-pages) */
.k-hero--bento { padding: 56px 0 88px; border-bottom: 1px solid var(--line); position: relative; overflow: hidden; }
.k-hero--sub { padding: 40px 0 72px; }
.k-hero--sub .k-hero-art { aspect-ratio: 1 / 0.82; }
.k-hero--sub .k-hero-art--single { aspect-ratio: 4 / 3; }
.k-hero--sub .k-hero-art--duo    { aspect-ratio: 1.4 / 1; }
.k-hero-bento {
  display: grid;
  grid-template-columns: 1fr 1.05fr;
  gap: 72px;
  align-items: center;
}
.k-hero-bento .k-display { letter-spacing: -0.025em; }
.k-hero-bento .k-eyebrow { color: var(--ink-soft); }

.k-hero-art {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 16px;
  aspect-ratio: 1 / 0.95;
}
.k-hero-art--single { grid-template-columns: 1fr; grid-template-rows: 1fr; aspect-ratio: 1 / 0.85; }
.k-hero-art--duo    { grid-template-columns: 1fr 1fr; grid-template-rows: 1fr; aspect-ratio: 1.5 / 1; }
.k-hero-tile {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--paper-2);
  border: 1px solid var(--line);
  z-index: 1;
}
.k-hero-tile img {
  width: 100%; height: 100%;
  object-fit: cover; display: block;
  transition: transform 0.7s ease;
}
.k-hero-tile:hover img { transform: scale(1.05); }

.k-hero-dots {
  position: absolute;
  top: -28px; right: -16px;
  width: 110px; height: 110px;
  background-image: radial-gradient(var(--red) 1.5px, transparent 1.8px);
  background-size: 12px 12px;
  opacity: 0.55;
  z-index: 0;
  pointer-events: none;
}
.k-hero-dots--bl {
  top: auto; right: auto;
  bottom: -22px; left: -14px;
  width: 84px; height: 60px;
  opacity: 0.45;
}

.k-hero-chip {
  position: absolute;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 18px;
  display: flex; gap: 14px; align-items: center;
  box-shadow: 0 22px 44px -20px rgba(14,14,14,0.28), 0 4px 10px -6px rgba(14,14,14,0.10);
  max-width: 260px;
  z-index: 5;
}
.k-hero-chip--top { top: 18%; right: -28px; }
.k-hero-chip--mid { bottom: 16%; left: -32px; }

.k-hero-chip-icon {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: rgba(177,18,38,0.10);
  color: var(--red);
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.k-hero-chip-icon svg { width: 18px; height: 18px; }
.k-hero-chip-label {
  font-weight: 500; color: var(--ink);
  font-size: 13.5px; line-height: 1.3;
}
.k-hero-chip-sub {
  font-size: 11.5px; color: var(--muted);
  letter-spacing: 0.02em;
  margin-top: 3px;
}
.k-hero-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--ink); color: #fff;
  font-family: var(--serif); font-size: 19px;
  display: inline-flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.k-hero-chip-line {
  display: block;
  width: 92px; height: 14px;
  color: var(--red);
  margin-top: 4px;
}

.k-hero-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0;
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.k-hero-stats .k-stat { padding: 4px 24px; border-left: 1px solid var(--line); }
.k-hero-stats .k-stat:first-child { border-left: 0; padding-left: 0; }
.k-hero-stats .k-stat .num { font-size: clamp(36px, 3.4vw, 52px); }

@media (max-width: 1024px) {
  .k-hero-bento { gap: 48px; }
  .k-hero-chip--top { right: -8px; }
  .k-hero-chip--mid { left: -8px; }
}
@media (max-width: 860px) {
  .k-hero--bento { padding: 32px 0 64px; }
  .k-hero-bento { grid-template-columns: 1fr !important; gap: 40px !important; }
  .k-hero-art { aspect-ratio: 1 / 1; }
  .k-hero-chip { max-width: 220px; padding: 12px 14px; }
  .k-hero-chip--top { top: 6%; right: -10px; }
  .k-hero-chip--mid { bottom: 6%; left: -10px; }
  .k-hero-stats { grid-template-columns: repeat(2, 1fr) !important; row-gap: 28px; margin-top: 56px; }
  .k-hero-stats .k-stat { padding: 0 18px; border-left: 0 !important; }
  .k-hero-stats .k-stat:nth-child(2) { border-left: 1px solid var(--line) !important; }
  .k-hero-stats .k-stat:nth-child(3) { border-top: 1px solid var(--line); padding-top: 28px; }
  .k-hero-stats .k-stat:nth-child(4) { border-top: 1px solid var(--line); padding-top: 28px; border-left: 1px solid var(--line) !important; }
}
@media (max-width: 480px) {
  .k-hero-chip { max-width: 180px; font-size: 12px; gap: 10px; padding: 10px 12px; }
  .k-hero-chip-icon, .k-hero-avatar { width: 32px; height: 32px; }
  .k-hero-chip-label { font-size: 12px; }
  .k-hero-chip-sub { font-size: 10.5px; }
}

/* Essay body — single post */
.ketch-essay { font-size: 17.5px; line-height: 1.75; color: var(--ink-soft); }
.ketch-essay > h2 {
  font-family: var(--serif);
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.012em;
  color: var(--ink);
  margin: 64px 0 20px;
  padding-bottom: 14px;
  position: relative;
  scroll-margin-top: 110px;
}
.ketch-essay > h2:first-child { margin-top: 0; }
.ketch-essay > h2::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 48px; height: 2px;
  background: var(--red);
}
.ketch-essay > h3 {
  font-family: var(--serif);
  font-size: clamp(22px, 2.4vw, 28px);
  line-height: 1.2;
  letter-spacing: -0.005em;
  color: var(--ink);
  margin: 40px 0 12px;
}
.ketch-essay p { margin: 0 0 22px; }
.ketch-essay strong { color: var(--ink); font-weight: 600; }
.ketch-essay a { color: var(--ink); border-bottom: 1px solid var(--red); }
.ketch-essay a:hover { color: var(--red); }
.ketch-essay ul, .ketch-essay ol {
  list-style: none;
  padding: 0;
  margin: 0 0 28px;
}
.ketch-essay ul li, .ketch-essay ol li {
  position: relative;
  padding: 12px 0 12px 32px;
  border-top: 1px solid var(--line);
}
.ketch-essay ul li:last-child, .ketch-essay ol li:last-child {
  border-bottom: 1px solid var(--line);
}
.ketch-essay ul li::before {
  content: "";
  position: absolute;
  left: 6px; top: 22px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--red);
}
.ketch-essay ol { counter-reset: essay-list; }
.ketch-essay ol li {
  counter-increment: essay-list;
  padding-left: 44px;
}
.ketch-essay ol li::before {
  content: counter(essay-list, decimal-leading-zero);
  position: absolute;
  left: 0; top: 14px;
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--red);
}
/* Standalone blockquote (not grouped) */
.ketch-essay > blockquote {
  margin: 40px 0;
  padding: 4px 0 4px 28px;
  border-left: 2px solid var(--red);
  font-family: var(--serif);
  font-size: 24px;
  line-height: 1.35;
  color: var(--ink);
}
.ketch-essay > blockquote p { margin: 0 0 12px; font-family: inherit; font-size: inherit; line-height: inherit; }
.ketch-essay > blockquote p:last-child { margin: 0; }
.ketch-essay > blockquote em { color: var(--red); font-style: italic; }

/* FAQ block */
.k-faq {
  margin: 64px 0;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 36px 40px;
}
.k-faq > h2 {
  font-family: var(--serif);
  font-size: clamp(26px, 2.8vw, 34px);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 0 0 24px;
  padding: 0;
  position: relative;
  padding-left: 22px;
}
.k-faq > h2::after { display: none; }
.k-faq > h2::before {
  content: "?";
  position: absolute; left: 0; top: 4px;
  font-family: var(--serif);
  color: var(--red);
  font-size: 1em;
  font-style: italic;
}
.k-faq-item {
  border-top: 1px solid var(--line);
  padding: 0;
}
.k-faq-item:last-child { border-bottom: 1px solid var(--line); }
.k-faq-item summary {
  font-family: var(--serif);
  font-size: 19px;
  line-height: 1.3;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 18px 0;
  outline: none;
  transition: color 0.18s ease;
}
.k-faq-item summary:hover { color: var(--red); }
.k-faq-item summary::-webkit-details-marker { display: none; }
.k-faq-item summary::after {
  content: "+";
  font-family: var(--serif);
  font-size: 28px;
  line-height: 1;
  color: var(--red);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  flex-shrink: 0;
}
.k-faq-item[open] summary::after { transform: rotate(45deg); }
.k-faq-answer {
  padding: 0 0 22px;
  font-family: var(--sans);
  font-size: 15.5px;
  line-height: 1.65;
  color: var(--ink-soft);
  max-width: 60ch;
}
.k-faq-answer p { margin: 0 0 12px; }
.k-faq-answer p:last-child { margin: 0; }

/* Testimonials grid (consecutive blockquotes) */
.k-quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 20px;
  margin: 56px 0;
}
.k-quotes blockquote {
  margin: 0;
  padding: 28px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  font-family: var(--serif);
  font-size: 17.5px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: relative;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.k-quotes blockquote:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.k-quotes blockquote::before {
  content: "★★★★★";
  display: block;
  color: var(--red);
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.12em;
  margin-bottom: 4px;
}
.k-quotes blockquote p {
  margin: 0;
  font-family: inherit;
  font-size: inherit;
  line-height: inherit;
}
.k-quotes blockquote p:has(strong) {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.k-quotes blockquote strong {
  display: inline;
  font-family: var(--sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

/* Single-post Table of Contents (sticky left rail) */
.k-essay-toc .k-toc-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0;
  font-size: 13px;
}
.k-essay-toc .k-toc-list li {
  border-top: 1px solid var(--line);
}
.k-essay-toc .k-toc-list li:last-child {
  border-bottom: 1px solid var(--line);
}
.k-essay-toc .k-toc-list a {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 10px;
  padding: 10px 0;
  color: var(--ink-soft);
  align-items: baseline;
  transition: color 0.18s ease;
}
.k-essay-toc .k-toc-list a:hover { color: var(--ink); }
.k-essay-toc .k-toc-num {
  font-family: var(--mono);
  font-size: 10.5px;
  letter-spacing: 0.06em;
  color: var(--red);
  padding-top: 2px;
}
.k-essay-toc .k-toc-title {
  font-family: var(--sans);
  line-height: 1.35;
}

/* Mobile: collapse rails, tighten essay */
@media (max-width: 960px) {
  .k-essay-layout { grid-template-columns: 1fr !important; gap: 32px !important; }
  .k-essay-toc { position: static !important; }
  .k-faq { padding: 28px 24px; }
  .ketch-essay { font-size: 16.5px; line-height: 1.7; }
  .k-quotes { grid-template-columns: 1fr; gap: 16px; }
}

/* Blog pagination */
.k-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 80px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.k-page-link {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--ink);
  padding: 12px 18px;
  border: 1px solid var(--ink);
  border-radius: var(--radius);
  background: transparent;
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.k-page-link:hover { background: var(--ink); color: var(--paper); }
.k-page-link--disabled {
  color: var(--muted-2);
  border-color: var(--line);
  cursor: not-allowed;
}
.k-page-link--disabled:hover { background: transparent; color: var(--muted-2); }

.k-page-numbers {
  list-style: none;
  display: flex;
  gap: 6px;
  padding: 0;
  margin: 0;
  flex-wrap: wrap;
  justify-content: center;
  flex: 1;
}
.k-page-number {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.06em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 40px;
  height: 40px;
  padding: 0 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  color: var(--ink-soft);
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}
.k-page-number:hover { border-color: var(--ink); color: var(--ink); }
.k-page-number--current {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
}
@media (max-width: 640px) {
  .k-pagination { gap: 16px; }
  .k-page-link { padding: 10px 14px; font-size: 11px; }
  .k-page-number { min-width: 36px; height: 36px; font-size: 11px; }
}

/* Blog archive month/year filter — styled to match the pill row */
.k-archive-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.k-archive-select-wrap::after {
  content: "";
  position: absolute;
  right: 14px;
  top: 50%;
  width: 8px; height: 8px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  transform: translateY(-65%) rotate(45deg);
  pointer-events: none;
}
.k-archive-select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  font-family: var(--sans);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 10px 36px 10px 16px;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.18s ease, color 0.18s ease;
}
.k-archive-select:hover { border-color: var(--ink); color: var(--ink); }
.k-archive-select:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

/* WhatsApp floating action button */
.whatsapp-fab {
  position: fixed;
  right: calc(24px + env(safe-area-inset-right, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  display: inline-flex;
  align-items: center;
  gap: 0;
  height: 60px;
  padding: 0 18px;
  border-radius: 999px;
  background: #25D366;
  color: #ffffff !important;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 500;
  letter-spacing: 0.01em;
  text-decoration: none;
  box-shadow: 0 14px 36px -10px rgba(37, 211, 102, 0.55), 0 4px 12px -4px rgba(14, 14, 14, 0.18);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.25s ease, background 0.25s ease, gap 0.3s ease, padding 0.3s ease;
  overflow: hidden;
  white-space: nowrap;
}
.whatsapp-fab:hover {
  background: #128C7E;
  transform: translateY(-2px);
  box-shadow: 0 20px 44px -10px rgba(18, 140, 126, 0.60), 0 6px 16px -4px rgba(14, 14, 14, 0.22);
  gap: 12px;
}
.whatsapp-fab:focus-visible {
  outline: 2px solid #ffffff;
  outline-offset: 3px;
}
.whatsapp-fab::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 999px;
  box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55);
  animation: whatsapp-fab-pulse 2.6s ease-out infinite;
  pointer-events: none;
}
@keyframes whatsapp-fab-pulse {
  0%   { box-shadow: 0 0 0 0   rgba(37, 211, 102, 0.45); }
  70%  { box-shadow: 0 0 0 18px rgba(37, 211, 102, 0); }
  100% { box-shadow: 0 0 0 0   rgba(37, 211, 102, 0); }
}
.whatsapp-fab__icon {
  flex-shrink: 0;
  width: 28px; height: 28px;
}
.whatsapp-fab__label {
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  transition: max-width 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
}
.whatsapp-fab:hover .whatsapp-fab__label,
.whatsapp-fab:focus-visible .whatsapp-fab__label {
  max-width: 240px;
  opacity: 1;
}

@media (max-width: 640px) {
  .whatsapp-fab {
    right: 16px; bottom: 16px;
    height: 56px; padding: 0 14px;
  }
  .whatsapp-fab__icon { width: 26px; height: 26px; }
  .whatsapp-fab__label { display: none; }
}

/* Modernization polish */
.k-input, .k-textarea, .k-select { transition: border-color 0.18s ease; }
.k-link { transition: color 0.18s ease, border-color 0.18s ease; }
.k-service-card { transition: color 0.2s ease; }
a, button, summary, input[type="submit"], .k-pill { -webkit-tap-highlight-color: transparent; }
a, button, summary, [role="button"] { cursor: pointer; }
details summary { list-style: none; outline: none; }
details summary::-webkit-details-marker { display: none; }
details summary::after {
  content: "+"; float: right; font-family: var(--serif);
  font-size: 28px; line-height: 1; color: var(--muted);
  transition: transform 0.2s ease;
}
details[open] summary::after { transform: rotate(45deg); color: var(--red); }

/* Generic card-like blocks (priority cards, hardware cards, FAQ tiles, blog cards, contact aside form items) get a subtle rounded corner */
article[style*="border:1px solid"][style*="padding"],
.k-container article[style*="background:var(--ink)"],
.k-container div[style*="border:1px solid var(--line)"][style*="padding:24px"],
.k-container div[style*="border:1px solid var(--line)"][style*="padding:36px"],
.k-container a[style*="border:1px solid var(--line)"][style*="padding:20px"],
.k-container a[style*="border:1px solid var(--line)"][style*="padding:24px"] {
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.k-container a[style*="border:1px solid var(--line)"]:hover {
  border-color: var(--line-strong);
}
.k-table { border-radius: var(--radius); overflow: hidden; }
input.k-input, textarea.k-textarea, select.k-select { border-radius: 0; }
img[style*="object-fit:cover"], img[style*="object-fit: cover"] { border-radius: var(--radius); }

/* Mobile nav toggle */
.k-nav-toggle {
  display: none;
  width: 40px; height: 40px;
  background: transparent; border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  align-items: center; justify-content: center;
  padding: 0;
}
.k-nav-toggle span {
  position: relative; display: block;
  width: 18px; height: 1.5px; background: var(--ink);
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.k-nav-toggle span::before,
.k-nav-toggle span::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 1.5px; background: var(--ink);
  transition: transform 0.2s ease;
}
.k-nav-toggle span::before { top: -6px; }
.k-nav-toggle span::after  { top:  6px; }
body.nav-open .k-nav-toggle span { background: transparent; }
body.nav-open .k-nav-toggle span::before { transform: translateY(6px) rotate(45deg); }
body.nav-open .k-nav-toggle span::after  { transform: translateY(-6px) rotate(-45deg); }

/* Footer social — replace text squares with proper iconography */
.k-social { display: flex; gap: 10px; margin-top: 28px; }
.k-social a {
  width: 38px; height: 38px;
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius);
  display: inline-flex; align-items: center; justify-content: center;
  color: rgba(255,255,255,0.85);
  transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.k-social a:hover {
  background: var(--red); border-color: var(--red); color: #fff;
  transform: translateY(-1px);
}
.k-social svg { width: 16px; height: 16px; }

/* Tablet */
@media (max-width: 1024px) {
  .k-utility-inner { gap: 12px; flex-wrap: wrap; font-size: 11.5px; padding: 8px var(--gutter); }
  .k-footer-grid { grid-template-columns: 1fr 1fr 1fr; gap: 32px; }
  .k-trust { gap: 16px 24px; }
}

/* Mobile breakpoint — hamburger nav, single column, stacking grids */
@media (max-width: 860px) {
  :root { --gutter: 20px; }

  .k-nav-inner { grid-template-columns: 1fr auto; gap: 12px; }
  .k-navlinks {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; gap: 0;
    background: var(--paper); border-bottom: 1px solid var(--line);
    padding: 4px var(--gutter) 12px;
    box-shadow: 0 18px 32px -20px rgba(14,14,14,0.22);
  }
  .k-navlinks.is-open { display: flex; }
  .k-navlinks a {
    padding: 16px 14px;
    border-bottom: 1px solid var(--line);
    font-size: 16px;
    border-left: 3px solid transparent;
    border-radius: 0;
    color: var(--ink);
    transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
  }
  .k-navlinks a:last-child { border-bottom: 0; }
  .k-navlinks > .k-navitem:last-child > a { border-bottom: 0; }
  /* Dropdown becomes inline collapsible block */
  .k-navlinks .k-navitem { display: block; width: 100%; position: relative; }
  .k-navlinks .k-navitem--has-children > a {
    display: flex; justify-content: space-between; align-items: center;
    padding-right: 56px; /* room for the toggle */
  }
  .k-navlinks .k-navitem--has-children > a .caret { display: none; }
  .k-navitem-toggle {
    display: inline-flex; align-items: center; justify-content: center;
    position: absolute; right: 8px; top: 8px;
    width: 40px; height: 40px;
    background: transparent; border: 1px solid var(--line);
    border-radius: var(--radius);
  }
  .k-navitem-toggle span,
  .k-navitem-toggle span::before {
    content: ""; display: block; width: 12px; height: 1.5px; background: var(--ink);
    position: relative;
  }
  .k-navitem-toggle span::before { position: absolute; left: 0; top: 0; transform: rotate(90deg); transition: transform 0.2s ease; }
  .k-navitem.is-open .k-navitem-toggle span::before { transform: rotate(0); }
  .k-navsub {
    position: static; opacity: 1; visibility: hidden; transform: none;
    box-shadow: none; border: 0; border-radius: 0;
    padding: 0; min-width: 0;
    background: transparent;
    max-height: 0; overflow: hidden; pointer-events: none;
    transition: max-height 0.25s ease;
  }
  .k-navitem.is-open .k-navsub {
    visibility: visible; pointer-events: auto;
    max-height: 600px;
    padding: 4px 0 8px;
  }
  .k-navsub a {
    padding: 12px 14px 12px 28px;
    font-size: 15px;
    border-bottom: 1px solid var(--line);
    border-left: 3px solid transparent;
  }
  .k-navsub a:last-child { border-bottom: 0; }
  .k-navsub a.active { background: var(--paper-2); border-left-color: var(--red); }
  .k-navlinks a:hover { background: var(--paper-2); border-left-color: var(--line-strong); }
  .k-navlinks a.active {
    color: var(--red);
    border-left-color: var(--red);
    background: var(--paper-2);
  }
  .k-navlinks a::after { display: none; }
  .k-nav-cta { display: none; }
  .k-nav-toggle { display: inline-flex; }
  /* Keep nav stuck to the top on mobile too — the dropdown panel still
     anchors correctly because sticky establishes its own containing block */
  .k-nav { position: sticky; top: 0; }

  .k-utility-inner { font-size: 11px; }
  .k-utility-inner > div:first-child { flex: 1 1 100%; }
  .k-utility .right { gap: 14px; }

  .k-hero { padding: 48px 0 64px; }
  .k-hero-grid { grid-template-columns: 1fr; gap: 40px; }

  /* Collapse every multi-column inline grid to one column on mobile —
     matches both the wrapper itself and any descendant that declares its own grid */
  .k-container[style*="grid-template-columns"],
  .k-container [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    gap: 32px !important;
  }
  /* Reset any inline grid-column placement (e.g. `grid-column:2 / span 2`)
     so children stack naturally instead of being pushed into a phantom column */
  .k-container [style*="grid-column"] {
    grid-column: auto !important;
  }
  /* Brand grid on digital-locks page: keep 2 columns instead of 5
     (specificity bumped with `section` so it outranks the generic .k-container collapse above) */
  section [style*="grid-template-columns:repeat(5"],
  section.k-container[style*="grid-template-columns:repeat(5"],
  section .k-container[style*="grid-template-columns:repeat(5"],
  .k-container[style*="grid-template-columns:repeat(5"],
  .k-container [style*="grid-template-columns:repeat(5"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 16px !important;
  }
  /* Hardware / stat grid (4 cols) → 2x2 */
  section [style*="grid-template-columns:repeat(4"],
  .k-container[style*="grid-template-columns:repeat(4"],
  .k-container [style*="grid-template-columns:repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 0 !important;
  }
  /* Stat row in dark hero (4 col, no border-left in 2-col layout) */
  section [style*="grid-template-columns:repeat(4, 1fr)"] > div { border-left: 0 !important; padding-left: 0 !important; }

  .k-display, .k-h1 { font-size: clamp(40px, 10vw, 64px) !important; line-height: 1.02 !important; }
  .k-h2 { font-size: clamp(32px, 7vw, 48px) !important; }
  .k-h3 { font-size: clamp(22px, 5.2vw, 30px) !important; }
  .k-lede { font-size: 17px; }

  .k-section { padding: 64px 0; }
  .k-section--lg { padding: 96px 0; }
  .k-section--sm { padding: 48px 0; }

  .k-footer { padding: 64px 0 24px; }
  .k-footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; padding-bottom: 40px; }
  .k-footer-meta { flex-direction: column; align-items: flex-start; gap: 12px; }

  /* Trust strip: stack to a single column on mobile so we don't get
     space-between blowing the last wrapped row apart */
  .k-trust {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    padding: 20px 0;
  }
  .k-trust .item {
    font-size: 10.5px;
    line-height: 1.4;
    position: relative;
    padding-left: 14px;
  }
  .k-trust .item::before {
    content: "";
    position: absolute;
    left: 0; top: 50%;
    width: 4px; height: 4px;
    margin-top: -2px;
    background: var(--red);
    border-radius: 50%;
  }

  .k-table { display: block; overflow-x: auto; }
  .k-table th, .k-table td { padding: 14px 12px; }

  /* Big inline forms with two-column inner grids */
  form [style*="grid-template-columns:1fr 1fr"] { grid-template-columns: 1fr !important; gap: 24px !important; }

  /* Contact aside — drop the left rule when stacking */
  aside[style*="border-left"] { border-left: 0 !important; padding-left: 0 !important; padding-top: 32px; border-top: 1px solid var(--line); }

  /* Article TOC + share rails on single.php */
  article aside[style*="position:sticky"] { position: static !important; top: auto !important; }

  /* Image scaling — make large fixed-height images shrink on mobile */
  .k-ph, img[style*="height:560px"], img[style*="height:520px"], img[style*="height:460px"], img[style*="height:300px"], img[style*="height:280px"], img[style*="height:220px"] {
    max-height: 60vh;
  }

  /* Testimonials wall: collapse from 2 columns to 1 */
  div[style*="column-count:2"] { column-count: 1 !important; }
}

@media (max-width: 480px) {
  .k-footer-grid { grid-template-columns: 1fr; }
  .k-utility-inner { padding: 8px 16px; }
  .k-utility .right { flex-wrap: wrap; gap: 10px 18px; }
  .k-btn { padding: 12px 18px; font-size: 12px; }
  .k-btn--lg { padding: 14px 20px; font-size: 12px; }
  /* Stack hardware + brand grids to single column on the smallest screens */
  section [style*="grid-template-columns:repeat(4"],
  section [style*="grid-template-columns:repeat(5"] {
    grid-template-columns: 1fr !important;
  }
}

/* ============================================================
   Responsive polish pass
   ============================================================ */

/* Tablet (max-width: 1024px) — collapse cramped grids before they break */
@media (max-width: 1024px) {
  .k-hero-bento { gap: 40px; }

  /* Section paddings start to compress */
  section[style*="padding:120px 0"] { padding-top: 80px !important; padding-bottom: 80px !important; }
  section[style*="padding:140px 0"] { padding-top: 96px !important; padding-bottom: 96px !important; }
  section[style*="padding:96px 0"]  { padding-top: 64px !important; padding-bottom: 64px !important; }

  /* Generic 4-col card grids → 2x2 */
  .k-container [style*="grid-template-columns:repeat(4, 1fr)"],
  .k-container [style*="grid-template-columns:repeat(4,1fr)"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }
  /* 5-col brand grid → 3-col */
  .k-container [style*="grid-template-columns:repeat(5, 1fr)"],
  .k-container [style*="grid-template-columns:repeat(5,1fr)"] {
    grid-template-columns: repeat(3, 1fr) !important;
  }

  /* Hero stats stays 4 across but tighten the type */
  .k-hero-stats .k-stat .num { font-size: clamp(28px, 3.4vw, 44px); }
  .k-hero-stats .k-stat { padding: 4px 16px; }

  /* Three-column quote/eyebrow bands (e.g. "From the workshop") get a saner gap */
  .k-container [style*="gap:80px"] { gap: 56px !important; }
}

/* Mobile (≤860px) — section padding reductions for inline-styled blocks */
@media (max-width: 860px) {
  /* Compress oversized section paddings used throughout the templates */
  section[style*="padding:120px 0"] { padding-top: 56px !important; padding-bottom: 56px !important; }
  section[style*="padding:140px 0"] { padding-top: 64px !important; padding-bottom: 64px !important; }
  section[style*="padding:100px 0"] { padding-top: 48px !important; padding-bottom: 48px !important; }
  section[style*="padding:96px 0"]  { padding-top: 48px !important; padding-bottom: 48px !important; }
  section[style*="padding:80px 0 64px"] { padding: 40px 0 32px !important; }
  section[style*="padding:80px 0 56px"] { padding: 40px 0 28px !important; }
  section[style*="padding:80px 0 0"]    { padding: 40px 0 0 !important; }
  section[style*="padding:80px 0 96px"] { padding: 40px 0 48px !important; }
  section[style*="padding:80px 0 120px"]{ padding: 40px 0 56px !important; }
  section[style*="padding:80px 0"]      { padding: 40px 0 !important; }
  section[style*="padding:64px 0"]      { padding: 36px 0 !important; }

  /* Loosen up oversized inline gaps */
  .k-container [style*="gap:80px"] { gap: 32px !important; }
  .k-container [style*="gap:64px"] { gap: 28px !important; }
  .k-container [style*="gap:48px"] { gap: 24px !important; }

  /* Bento art aspect ratio more compact on phones */
  .k-hero-art          { aspect-ratio: 1 / 0.7; }
  .k-hero-art--single  { aspect-ratio: 4 / 3; }
  .k-hero-art--duo     { aspect-ratio: 1.2 / 1; }

  /* Drop fixed hero-image heights so they scale to viewport */
  .k-container > div [style*="height:560px"],
  .k-container [style*="height:520px"],
  .k-container [style*="height:460px"],
  .k-container [style*="height:300px"] {
    height: auto !important;
    min-height: 240px;
  }

  /* Service cards (home) — readable when 2-col stacks to 1 below 480 */
  .k-service-card { padding: 24px 0 28px; }
  .k-service-card .title { font-size: clamp(20px, 5.6vw, 26px); }

  /* Big chapter numbers on Our Story */
  .k-container [style*="font-size:clamp(96px"] {
    font-size: clamp(64px, 18vw, 120px) !important;
    text-align: left !important;
  }

  /* Single-post header date strip: 4 across is too cramped */
  article header .k-container [style*="grid-template-columns:repeat(4"] {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 20px !important;
  }

  /* Pillar / standards 4-col cards already collapse to 2 then 1 — tighten gap + hairline */
  .k-container [style*="grid-template-columns:repeat(4"] {
    gap: 24px !important;
  }

  /* Pagination tighter */
  .k-pagination { gap: 12px; margin-top: 56px; padding-top: 24px; }
  .k-page-numbers { gap: 4px; }
  .k-page-link { padding: 10px 14px; font-size: 11px; }
  .k-page-number { min-width: 36px; height: 36px; }

  /* Footer social wrapping */
  .k-social { flex-wrap: wrap; }

  /* Logo a touch smaller */
  .k-logo--image img { height: 40px; }

  /* Utility strip ultra-compact */
  .k-utility-inner { font-size: 10.5px; padding: 6px var(--gutter); }

  /* Quote ribbons (200px sidebar + content) become single column — already handled by the catch-all,
     but tidy up quote font-size when it does */
  .k-quote { font-size: clamp(22px, 5vw, 30px) !important; line-height: 1.3 !important; }
}

/* Phones (≤640px) — extra tightening */
@media (max-width: 640px) {
  /* Pull down all big serif headlines further */
  .k-display, .k-h1 { font-size: clamp(36px, 11vw, 56px) !important; line-height: 1.04 !important; }
  .k-h2            { font-size: clamp(26px, 7.2vw, 38px) !important; line-height: 1.1 !important; }
  .k-h3            { font-size: clamp(20px, 5.4vw, 26px) !important; line-height: 1.2 !important; }
  .k-lede          { font-size: 16px !important; }

  /* Standalone blockquote in essays — smaller */
  .ketch-essay > blockquote { font-size: 20px; line-height: 1.4; padding-left: 20px; }

  /* FAQ block tighter */
  .k-faq { padding: 24px 20px; }
  .k-faq-item summary { font-size: 17px; }

  /* Rates table padding tighter and price font smaller */
  .k-table th, .k-table td { padding: 12px 10px; font-size: 13.5px; }
  .k-table .price { font-size: 18px; }

  /* Two-column inline grids that didn't already collapse */
  .k-container [style*="grid-template-columns:1fr 1fr"],
  .k-container [style*="grid-template-columns:1.05fr 1fr"],
  .k-container [style*="grid-template-columns:1.1fr 1fr"],
  .k-container [style*="grid-template-columns:1.2fr 1fr"],
  .k-container [style*="grid-template-columns:1.4fr 1fr"],
  .k-container [style*="grid-template-columns:1fr 1.4fr"],
  .k-container [style*="grid-template-columns:1fr 2fr"] {
    grid-template-columns: 1fr !important;
  }

  /* Drop fixed-height hero "image" containers entirely */
  .k-container [style*="height:520px"],
  .k-container [style*="height:560px"] {
    height: auto !important;
    min-height: 220px;
  }

  /* Pillar / pricing rate header 4-col → 1-col on tiny screens */
  .k-container [style*="grid-template-columns:repeat(4"] {
    grid-template-columns: 1fr !important;
  }

  /* Brand grid (digital-locks) drop to 2-col */
  .k-container [style*="grid-template-columns:repeat(5"] {
    grid-template-columns: repeat(2, 1fr) !important;
  }

  /* Buttons stack and stretch */
  .k-hero-text > div[style*="display:flex"][style*="gap:14px"],
  .k-hero-bento .k-hero-text > div[style*="display:flex"] {
    width: 100%;
  }
  .k-btn, .k-btn--lg { width: 100%; justify-content: center; }
  /* But keep utility strip phone/email links inline */
  .k-utility .right .k-btn { width: auto; }

  /* Footer meta wraps clean */
  .k-footer-meta .legal { flex-wrap: wrap; gap: 12px; }
}

/* Very small phones (≤420px) */
@media (max-width: 420px) {
  :root { --gutter: 16px; }
  .k-section { padding: 36px 0 !important; }
  .k-section--lg { padding: 48px 0 !important; }
  .k-section--sm { padding: 28px 0 !important; }
  .k-display, .k-h1 { font-size: clamp(32px, 12vw, 44px) !important; }

  /* WhatsApp FAB compact */
  .whatsapp-fab { right: 12px; bottom: 12px; height: 52px; padding: 0 12px; }
  .whatsapp-fab__icon { width: 24px; height: 24px; }

  /* Service cards stack */
  .k-container [style*="grid-template-columns:repeat(4, 1fr)"],
  .k-container [style*="grid-template-columns:repeat(3, 1fr)"] {
    grid-template-columns: 1fr !important;
  }
}
