/* The Keys Handyman: marketing page. Tokens live in /assets/brand.css */
:root {
  --gold: #E3A13A;
  --gold-dark: #C9862A;
  --wrap: 1200px;
  --gutter: clamp(1.1rem, 4vw, 2.5rem);
  --nav-h: 76px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 8px); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 17px/1.6 var(--font-body); color: var(--ink); background: #fff; }
img, video { display: block; max-width: 100%; height: auto; }
h1, h2, h3 { font-family: var(--font-head); color: var(--navy); line-height: 1.08; margin: 0; letter-spacing: -.015em; }
h1 { font-weight: 800; font-size: clamp(2.2rem, 4.2vw, 3.7rem); }
h2 { font-weight: 800; font-size: clamp(1.9rem, 3.4vw, 2.9rem); }
h3 { font-weight: 600; font-size: 1.25rem; letter-spacing: 0; }
p { margin: 0 0 1em; }
a { color: var(--teal-dark); text-underline-offset: 3px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: 1rem; top: -100px; z-index: 100; background: var(--gold); color: var(--navy); font-weight: 600; padding: .7rem 1rem; border-radius: var(--r-sm); }
.skip:focus { top: 1rem; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .55rem; min-height: 48px; padding: .7rem 1.25rem; border-radius: var(--r-sm); border: 2px solid transparent; font: 600 1rem var(--font-body); text-decoration: none; cursor: pointer; transition: transform .18s var(--ease), background-color .18s, color .18s, border-color .18s, box-shadow .18s; }
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn-lg { min-height: 56px; padding: .85rem 1.5rem; font-size: 1.06rem; }
.btn-solid { background: var(--navy); color: #fff; }
.btn-solid:hover { background: var(--navy-deep); box-shadow: 0 8px 20px rgba(18, 50, 79, .25); }
.btn-gold { background: var(--gold); color: var(--navy-deep); }
.btn-gold:hover { background: #F0B24D; box-shadow: 0 8px 22px rgba(227, 161, 58, .35); }
.btn-ghost-light { border-color: rgba(255, 255, 255, .55); color: #fff; }
.btn-ghost-light:hover { border-color: #fff; background: rgba(255, 255, 255, .08); }

/* ---------- nav ---------- */
.nav { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px); border-bottom: 1px solid rgba(18, 50, 79, .08); }
.nav-in { display: flex; align-items: center; gap: 1.5rem; height: var(--nav-h); }
.nav-logo img { height: 46px; width: auto; }
.nav-links { display: flex; gap: .25rem; margin-left: auto; }
.nav-links a { position: relative; color: var(--navy); text-decoration: none; font-weight: 500; padding: .6rem .8rem; min-height: 44px; display: inline-flex; align-items: center; }
.nav-links a::after { content: ''; position: absolute; left: .8rem; right: .8rem; bottom: .45rem; height: 2px; background: var(--teal); transform: scaleX(0); transform-origin: left; transition: transform .25s var(--ease); }
.nav-links a:hover::after { transform: scaleX(1); }
@media (max-width: 900px) {
  :root { --nav-h: 64px; }
  .nav-links { display: none; }
  .nav-call { margin-left: auto; }
  .nav-logo img { height: 38px; }
}
@media (max-width: 520px) {
  .nav-call { display: none; }
  .nav-in { justify-content: center; }
}

/* ---------- hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 50fr) minmax(0, 50fr); min-height: calc(100vh - var(--nav-h)); min-height: calc(100svh - var(--nav-h)); background: var(--navy); color: #fff; }
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: clamp(2.5rem, 6vw, 5rem) clamp(1.5rem, 4vw, 4rem) clamp(2.5rem, 6vw, 5rem) max(var(--gutter), calc((100vw - var(--wrap)) / 2 + var(--gutter))); }
.hero h1 { color: #fff; margin-bottom: 1.2rem; }
.eyebrow { font: 600 .86rem var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--teal-light); margin-bottom: 1.2rem; }
.lede { font-size: clamp(1.06rem, 1.4vw, 1.22rem); color: rgba(255, 255, 255, .86); max-width: 34em; margin-bottom: 2rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-bottom: 1.4rem; }
.hero-note { font-size: .95rem; color: rgba(255, 255, 255, .7); max-width: 32em; margin: 0; }
.hero-media { position: relative; overflow: hidden; }
.hero-media img { width: 100%; height: 100%; object-fit: cover; object-position: 30% 75%; }
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-media { order: -1; aspect-ratio: 4 / 3; max-height: 46vh; width: 100%; }
  .hero-copy { padding: 2rem var(--gutter) 2.6rem; }
}

/* entrance: runs once on load */
@media (prefers-reduced-motion: no-preference) {
  .js [data-enter] > * { opacity: 0; transform: translateY(18px); animation: rise .8s var(--ease) forwards; }
  .js [data-enter] > *:nth-child(2) { animation-delay: .08s; }
  .js [data-enter] > *:nth-child(3) { animation-delay: .16s; }
  .js [data-enter] > *:nth-child(4) { animation-delay: .24s; }
  .js [data-enter] > *:nth-child(5) { animation-delay: .32s; }
  .js [data-enter="media"] > * { transform: scale(1.06); animation: settle 1.4s var(--ease) forwards; }
  .js [data-enter="media"] { clip-path: inset(0 0 0 100%); animation: wipe 1s .1s var(--ease) forwards; }
}
@keyframes rise { to { opacity: 1; transform: none; } }
@keyframes settle { to { opacity: 1; transform: none; } }
@keyframes wipe { to { clip-path: inset(0 0 0 0); } }

/* ---------- sections ---------- */
.sec { padding: clamp(4rem, 9vw, 7.5rem) 0; }
.sec-sand { background: var(--sand); }
.sec-navy { background: var(--navy); color: rgba(255, 255, 255, .86); }
.sec-navy h2, .sec-navy h3 { color: #fff; }
.sec-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem 3rem; flex-wrap: wrap; margin-bottom: clamp(2rem, 4vw, 3rem); }
.sec-head h2 { max-width: 17ch; }
.sec-head p { max-width: 30em; margin: 0; color: var(--muted); font-size: 1.08rem; }
.sec-navy .sec-head p { color: rgba(255, 255, 255, .75); }

.job { margin: .9rem 0 0; font-size: .98rem; color: var(--muted); }
.job strong { color: var(--navy); font-weight: 600; }

/* ---------- before/after compare ---------- */
.compare-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 2.5vw, 2rem); }
.compare { position: relative; margin: 0; }
.compare picture, .compare img { border-radius: var(--r-lg); }
.compare-after img, .compare-before img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.compare-before { position: absolute; inset: 0 0 auto 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.compare-before img { aspect-ratio: 4 / 5; }
.compare-handle { position: absolute; top: 0; left: var(--pos); width: 3px; aspect-ratio: auto; height: calc(100% - 2.6rem); transform: translateX(-50%); background: #fff; box-shadow: 0 0 0 1px rgba(0, 0, 0, .15); pointer-events: none; }
.compare-handle::after { content: ''; position: absolute; top: 50%; left: 50%; width: 46px; height: 46px; transform: translate(-50%, -50%); border-radius: 50%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M9 6l-6 6 6 6M15 6l6 6-6 6' fill='none' stroke='%2312324F' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 24px no-repeat; box-shadow: 0 4px 14px rgba(0, 0, 0, .25); transition: transform .2s var(--ease); }
.compare:hover .compare-handle::after { transform: translate(-50%, -50%) scale(1.08); }
.compare-range { position: absolute; inset: 0 0 2.6rem 0; width: 100%; height: calc(100% - 2.6rem); margin: 0; opacity: 0; cursor: ew-resize; touch-action: pan-y; }
.compare-range:focus-visible ~ .compare-handle::after, .compare:focus-within .compare-handle::after { outline: 3px solid var(--gold); outline-offset: 3px; }
.tag { position: absolute; top: 1rem; font: 600 .78rem var(--font-body); letter-spacing: .1em; text-transform: uppercase; padding: .35rem .7rem; border-radius: 99px; pointer-events: none; }
.tag-before { left: 1rem; background: rgba(11, 34, 54, .82); color: #fff; }
.tag-after { right: 1rem; background: var(--gold); color: var(--navy-deep); }
@media (max-width: 700px) { .compare-grid { grid-template-columns: 1fr; } }

/* ---------- more work ---------- */
.more-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1rem, 2.5vw, 2rem); align-items: start; }
.tile { position: relative; margin: 0; }
.tile picture, .tile video { display: block; overflow: hidden; border-radius: var(--r-lg); }
.tile img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; transition: transform .5s var(--ease); }
.tile:hover img { transform: scale(1.03); }
.tile-video video { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; background: var(--navy); }
.play { position: absolute; left: 50%; top: calc(50% - 1.4rem); transform: translate(-50%, -50%); width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--gold); color: var(--navy-deep); display: grid; place-items: center; cursor: pointer; box-shadow: 0 10px 28px rgba(0, 0, 0, .3); transition: transform .2s var(--ease); }
.play:hover { transform: translate(-50%, -50%) scale(1.07); }
.play:active { transform: translate(-50%, -50%) scale(.97); }
.play[hidden] { display: none; }
@media (max-width: 800px) { .more-grid { grid-template-columns: 1fr; } .tile img { aspect-ratio: 4 / 5; } }

/* ---------- services ---------- */
.svc-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
.svc { background: rgba(255, 255, 255, .05); border: 1px solid rgba(255, 255, 255, .12); border-radius: var(--r-lg); padding: 1.6rem 1.4rem; transition: transform .2s var(--ease), background-color .2s, border-color .2s; }
.svc:hover { transform: translateY(-2px); background: rgba(255, 255, 255, .08); border-color: rgba(111, 211, 201, .5); }
.svc-ic { width: 44px; height: 44px; color: var(--gold); margin-bottom: 1.2rem; }
.svc h3 { margin-bottom: .6rem; }
.svc p { margin: 0; font-size: .98rem; }
@media (max-width: 1000px) { .svc-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 560px) { .svc-grid { grid-template-columns: 1fr; } }

/* ---------- tiktok ---------- */
.tt { display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(2rem, 5vw, 5rem); align-items: center; }
.tt-copy h2 { margin-bottom: 1.2rem; max-width: 14ch; }
.tt-copy p { font-size: 1.1rem; color: var(--muted); max-width: 30em; margin-bottom: 2rem; }
.tt-embed { justify-self: center; width: min(100%, 380px); }
.tt-card { position: relative; display: block; border-radius: 22px; overflow: hidden; box-shadow: 0 20px 50px rgba(18, 50, 79, .22); transition: transform .25s var(--ease), box-shadow .25s; }
.tt-card:hover { transform: translateY(-2px); box-shadow: 0 26px 60px rgba(18, 50, 79, .28); }
.tt-card img { width: 100%; aspect-ratio: 9 / 14; object-fit: cover; transition: transform .5s var(--ease); }
.tt-card:hover img { transform: scale(1.03); }
.tt-badge { position: absolute; left: 1rem; bottom: 1rem; display: inline-flex; align-items: center; gap: .45rem; background: #000; color: #fff; font-weight: 600; padding: .55rem .9rem; border-radius: 99px; }
.tt-embed .tiktok-embed { margin: 0 !important; }
@media (max-width: 800px) { .tt { grid-template-columns: 1fr; } }

/* ---------- about ---------- */
.about { display: grid; grid-template-columns: 1fr 1.15fr; gap: clamp(2rem, 6vw, 6rem); align-items: center; }
.about-media picture { display: block; overflow: hidden; border-radius: var(--r-lg); }
.about-media img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; transition: transform .5s var(--ease); }
.about-media:hover img { transform: scale(1.03); }
.about-copy h2 { margin-bottom: 1.4rem; max-width: 16ch; }
.about-copy p { font-size: 1.1rem; color: #33414F; max-width: 34em; }
.area-h { font-size: .86rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-dark); margin: 2rem 0 .8rem; }
.area { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.area li { background: var(--sand); color: var(--navy); font-weight: 600; padding: .5rem .95rem; border-radius: 99px; }
@media (max-width: 800px) { .about { grid-template-columns: 1fr; } .about-media { order: 2; } }

/* ---------- contact ---------- */
.contact-in { text-align: center; display: flex; flex-direction: column; align-items: center; }
.contact-logo { width: 190px; height: auto; margin-bottom: 2rem; }
.contact h2 { max-width: 18ch; margin-bottom: 1rem; }
.contact-lede { font-size: 1.15rem; max-width: 34em; margin-bottom: 2rem; }
.contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: .8rem; margin-bottom: 2.6rem; }
.contact-list { list-style: none; margin: 0; padding: 1.6rem 0 0; border-top: 1px solid rgba(255, 255, 255, .15); display: flex; flex-wrap: wrap; justify-content: center; gap: 1rem 3rem; }
.contact-list li { display: flex; flex-direction: column; gap: .15rem; font-weight: 500; color: #fff; }
.contact-list span { font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; color: var(--teal-light); font-weight: 600; }
.contact-list a { color: #fff; text-decoration: none; background: linear-gradient(currentColor, currentColor) left bottom / 0 2px no-repeat; transition: background-size .25s var(--ease); min-height: 32px; display: inline-flex; align-items: center; }
.contact-list a:hover { background-size: 100% 2px; }

/* ---------- footer ---------- */
.foot { background: var(--navy-deep); color: rgba(255, 255, 255, .7); padding: 2rem 0; font-size: .92rem; }
.foot-in { display: flex; align-items: center; justify-content: space-between; gap: 1rem 2rem; flex-wrap: wrap; }
.foot img { height: 40px; width: auto; }
.foot p { margin: 0; }
.foot a { color: #fff; text-decoration: none; }

/* ---------- mobile call bar ---------- */
.callbar { display: none; }
@media (max-width: 900px) {
  .callbar { position: fixed; z-index: 45; left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; padding: .6rem var(--gutter) calc(.6rem + env(safe-area-inset-bottom)); background: rgba(255, 255, 255, .96); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: 1px solid rgba(18, 50, 79, .1); }
  .callbar a { display: flex; align-items: center; justify-content: center; min-height: 50px; border-radius: var(--r-sm); font-weight: 700; text-decoration: none; font-size: 1.05rem; }
  .callbar-call { background: var(--gold); color: var(--navy-deep); }
  .callbar-text { background: var(--navy); color: #fff; }
  body { padding-bottom: calc(74px + env(safe-area-inset-bottom)); }
}

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