/* ==========================================================
   Kaplika Tech — components.css
   Buttons, cards, team, clients, gallery, lightbox, forms
   ========================================================== */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  min-height: 48px; padding: .8rem 1.4rem;
  border: 2px solid transparent; border-radius: var(--radius);
  font-size: var(--fs-small); font-weight: 600; letter-spacing: .01em;
  text-decoration: none; cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--red); color: #fff; }
.btn--primary:hover { background: var(--red-dark); color: #fff; }
.btn--ghost { border-color: rgba(255,255,255,.7); color: #fff; background: transparent; }
.btn--ghost:hover { background: #fff; color: var(--navy); }
.btn--outline { border-color: var(--ink); color: var(--ink); background: transparent; }
.btn--outline:hover { background: var(--ink); color: #fff; }
.btn--small { min-height: 42px; padding: .55rem 1.1rem; }

.text-link {
  display: inline-flex; align-items: center; gap: .4rem;
  font-weight: 600; text-decoration: none; color: var(--ink);
  border-bottom: 2px solid var(--red); padding-bottom: 2px;
}
.text-link:hover { color: var(--red-dark); }

/* ---------- Media frames ---------- */
.frame { position: relative; }
.frame img { width: 100%; height: 100%; object-fit: cover; }
.frame--tall { aspect-ratio: 4 / 5; }
.frame--wide { aspect-ratio: 3 / 2; }
.frame-tag {
  position: absolute; left: 0; bottom: 0;
  background: var(--red); color: #fff;
  padding: .7rem 1.1rem; font-size: var(--fs-small); font-weight: 600;
}

/* ---------- Stats ---------- */
.stat { border-top: 2px solid var(--ink); padding-top: .9rem; }
.stat strong { display: block; font-size: 2.5rem; line-height: 1; color: var(--ink); font-weight: 600; letter-spacing: -0.02em; margin-bottom: .35rem; }
.stat span { font-size: var(--fs-small); color: var(--muted); }

/* ---------- Mission box ---------- */
.callout {
  background: var(--navy); color: var(--on-dark);
  padding: 1.75rem 2rem; border-left: 0; margin-top: 2rem;
}
.callout h3 { color: #fff; margin-bottom: .5rem; font-size: 1.0625rem; }
.callout p { margin: 0; }

/* ---------- Service cards ---------- */
.service-card {
  display: flex; flex-direction: column; gap: 1rem;
  background: var(--paper);
  border-top: 3px solid var(--ink);
  padding: 1.75rem 0 0;
}
.service-card .icon { width: 44px; height: 44px; color: var(--red); }
.service-card h3 { margin: 0; }
.service-card ul { list-style: none; display: grid; gap: .45rem; font-size: var(--fs-small); }
.service-card li { padding-left: 1.1rem; position: relative; }
.service-card li::before { content: ""; position: absolute; left: 0; top: .72em; width: 6px; height: 2px; background: var(--red); }

.cta-card {
  display: flex; flex-direction: column; gap: 1rem; justify-content: space-between;
  background: var(--red); color: #fff; padding: 2rem;
}
.cta-card h3 { color: #fff; font-size: 1.5rem; margin: 0; }
.cta-card p { margin: 0; }
.cta-card .btn { background: #fff; color: var(--red-dark); align-self: flex-start; }
.cta-card .btn:hover { background: var(--ink); color: #fff; }

/* Detailed service rows (services page) */
.service-row { padding-block: clamp(3rem, 6vw, 4.5rem); border-top: 1px solid var(--line); }
.service-row:first-child { border-top: 0; }
.service-row .num { font-size: var(--fs-small); font-weight: 600; color: var(--red-dark); margin-bottom: .5rem; display: block; }
.service-row ul { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem 1.5rem; margin-top: 1.5rem; }
.service-row li { padding-left: 1.1rem; position: relative; }
.service-row li::before { content: ""; position: absolute; left: 0; top: .78em; width: 6px; height: 2px; background: var(--red); }
.service-row .frame { aspect-ratio: 4 / 3; }
.service-row:nth-child(even) .split > :first-child { order: 2; }
@media (max-width: 900px) {
  .service-row:nth-child(even) .split > :first-child { order: 0; }
}
@media (max-width: 520px) { .service-row ul { grid-template-columns: 1fr; } }

/* ---------- Browser mockup frame (web design samples) ---------- */
.browser-frame { background: #fff; border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; }
.service-row .browser-frame { aspect-ratio: auto; }
.browser-bar { display: flex; gap: 6px; align-items: center; height: 30px; padding: 0 12px; background: var(--mist); border-bottom: 1px solid var(--line); flex-shrink: 0; }
.browser-bar i { width: 10px; height: 10px; border-radius: 50%; background: #C9CCD2; }
.browser-bar i:first-child { background: var(--red); }
.browser-frame img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; object-position: top; }

/* ---------- Design project cards ---------- */
.project-card { display: flex; flex-direction: column; gap: .35rem; text-decoration: none; color: var(--text); }
.project-card:hover { color: var(--text); }
.project-media { display: block; overflow: hidden; margin-bottom: .75rem; background: #E8E9EC; aspect-ratio: 16 / 10; }
.project-media > img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.project-media.browser-frame > img { flex: 1; min-height: 0; height: auto; aspect-ratio: auto; }
.project-card:hover .project-media > img { transform: scale(1.03); }
.project-type { font-size: var(--fs-tiny); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red-dark); }
.project-title { font-size: 1.25rem; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.project-client { font-size: var(--fs-small); color: var(--muted); }

/* ---------- Values ---------- */
.value { border-top: 1px solid var(--line); padding-top: 1.5rem; }
.value .icon { width: 40px; height: 40px; color: var(--red); margin-bottom: 1rem; }
.value h3 { margin-bottom: .5rem; }
.value p { margin: 0; font-size: var(--fs-small); }

/* ---------- Quote ---------- */
.quote-block {
  display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  background: var(--navy); color: var(--on-dark);
}
.quote-block img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 25%; min-height: 320px; }
.quote-block figure { margin: 0; padding: clamp(2rem, 5vw, 4rem); display: flex; flex-direction: column; justify-content: center; gap: 1.25rem; }
.quote-block blockquote { margin: 0; font-size: clamp(1.25rem, 2.2vw, 1.6rem); line-height: 1.45; color: #fff; font-weight: 400; }
.quote-block .quote-mark { width: 40px; color: var(--red); }
.quote-block figcaption { font-size: var(--fs-small); letter-spacing: .06em; text-transform: uppercase; color: var(--red-soft); font-weight: 600; }
@media (max-width: 760px) {
  .quote-block { grid-template-columns: 1fr; }
  .quote-block img { max-height: 380px; }
}

/* ---------- Director message ---------- */
.director-photo { position: relative; }
.director-photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; object-position: 50% 25%; }
.signature { margin-top: 2rem; }
.signature strong { display: block; color: var(--ink); font-size: 1.25rem; }
.signature span { color: var(--muted); font-size: var(--fs-small); }

/* ---------- Team / org chart ---------- */
.org-lead { display: flex; flex-direction: column; align-items: center; text-align: center; }
.org-connector { position: relative; height: 56px; margin-inline: auto; max-width: 75%; }
.org-connector::before { content: ""; position: absolute; left: 50%; top: 0; width: 2px; height: 28px; background: var(--ink); }
.org-connector::after { content: ""; position: absolute; left: 0; right: 0; top: 28px; height: 28px; border: 2px solid var(--ink); border-bottom: 0; }
.team-card { display: flex; flex-direction: column; align-items: center; text-align: center; }
.team-card img {
  width: 148px; height: 148px; border-radius: 50%; object-fit: cover; object-position: 50% 25%;
  margin-bottom: 1rem;
}
.org-lead img { width: 180px; height: 180px; border: 4px solid var(--red); }
.team-card h3 { margin: 0 0 .25rem; font-size: 1.125rem; }
.team-card .role { font-size: var(--fs-tiny); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red-dark); margin-bottom: .6rem; }
.team-card p { font-size: var(--fs-small); margin: 0; max-width: 18rem; }
@media (max-width: 1000px) { .org-connector { display: none; } .org-lead { margin-bottom: 2.5rem; } }

/* ---------- Clients ---------- */
.client-card { display: flex; flex-direction: column; gap: .9rem; }
.client-logo {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16 / 9; background: #fff; border: 1px solid var(--line); padding: 1.5rem;
}
.client-logo img { max-height: 100%; width: auto; max-width: 80%; object-fit: contain; }
.client-card h3 { margin: 0; font-size: 1.0625rem; }
.client-card p { margin: 0; font-size: var(--fs-small); }

.logo-strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 1rem; }
.logo-strip .client-logo { aspect-ratio: 3 / 2; padding: 1rem; }
@media (max-width: 900px) { .logo-strip { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 480px) { .logo-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

/* ---------- Compliance ---------- */
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem 2rem; }
.fact { border-top: 2px solid var(--ink); padding-top: .75rem; }
.fact span { display: block; font-size: var(--fs-tiny); color: var(--muted); }
.fact strong { color: var(--ink); font-size: 1.0625rem; }
.fact--ok { border-color: var(--red); }
.fact--ok strong { color: var(--red-dark); }
@media (max-width: 760px) { .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .facts { grid-template-columns: 1fr; } }

.certs { display: grid; grid-template-columns: 1fr 1fr 1.4fr; gap: 1.5rem; align-items: end; }
.cert { margin: 0; }
.cert a { display: block; background: #fff; box-shadow: var(--shadow); transition: transform .25s var(--ease); }
.cert a:hover { transform: translateY(-4px); }
.cert figcaption { margin-top: .9rem; font-size: var(--fs-small); color: var(--text); }
.cert figcaption strong { display: block; color: var(--ink); }
@media (max-width: 760px) { .certs { grid-template-columns: 1fr 1fr; } .certs .cert:last-child { grid-column: 1 / -1; } }

/* ---------- Work teaser (home) ---------- */
.work-teaser {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: clamp(150px, 18vw, 230px);
  gap: .75rem;
}
.work-teaser a { position: relative; overflow: hidden; display: block; }
.work-teaser a:first-child { grid-column: span 2; grid-row: span 2; }
.work-teaser img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.work-teaser a:hover img { transform: scale(1.04); }
.work-teaser span {
  position: absolute; left: 0; bottom: 0;
  padding: .45rem .8rem; background: rgba(19,31,53,.85); color: #fff;
  font-size: var(--fs-tiny); font-weight: 600; letter-spacing: .03em;
}
@media (max-width: 700px) {
  .work-teaser { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: 150px; }
}

/* ---------- Gallery (work page) ---------- */
.filters {
  display: flex; flex-wrap: wrap; gap: .5rem;
  margin-bottom: 2rem;
}
.filter-btn {
  min-height: 44px; padding: .5rem 1.1rem;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--paper); color: var(--ink);
  font-size: var(--fs-small); font-weight: 500; cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.filter-btn:hover { border-color: var(--ink); }
.filter-btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.filter-btn .count { opacity: .65; margin-left: .3rem; font-size: var(--fs-tiny); }

.gallery {
  columns: 3 280px;
  column-gap: .75rem;
}
.gallery .tile {
  display: block; position: relative; overflow: hidden;
  margin-bottom: .75rem; break-inside: avoid; background: var(--mist);
}
.gallery .tile img { width: 100%; transition: transform .5s var(--ease); }
.gallery .tile:hover img { transform: scale(1.03); }
.gallery .tile .tile-label {
  position: absolute; left: 0; bottom: 0;
  padding: .4rem .75rem; background: rgba(19,31,53,.85); color: #fff;
  font-size: var(--fs-tiny); font-weight: 600;
  opacity: 0; transform: translateY(6px); transition: opacity .25s, transform .25s;
}
.gallery .tile:hover .tile-label,
.gallery .tile:focus-visible .tile-label { opacity: 1; transform: none; }
.gallery .tile[hidden] { display: none; }

/* Video tiles: always-visible label and a play button */
.gallery .tile--video .tile-label { opacity: 1; transform: none; background: var(--red); }
.play-badge {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  display: flex; align-items: center; justify-content: center;
  width: 64px; height: 64px; border-radius: 50%;
  background: rgba(19,31,53,.78); color: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,.35);
  transition: background .2s, transform .25s var(--ease);
}
.play-badge svg { width: 28px; height: 28px; margin-left: 3px; }
.gallery .tile--video:hover .play-badge { background: var(--red); transform: translate(-50%, -50%) scale(1.08); }

.lightbox video { max-width: 100%; max-height: 100%; background: #000; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox video[hidden], .lightbox img[hidden] { display: none; }

.category-intro { margin: -0.5rem 0 2rem; color: var(--muted); min-height: 1.6em; }

/* ---------- Lightbox ---------- */
.lightbox {
  position: fixed; inset: 0; z-index: 100;
  display: none; align-items: center; justify-content: center;
  background: rgba(10, 16, 28, .94);
  padding: 4.5rem 4.5rem 5rem;
}
.lightbox.is-open { display: flex; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 20px 60px rgba(0,0,0,.5); }
.lightbox-caption { position: absolute; left: 0; right: 0; bottom: 1.5rem; text-align: center; color: var(--on-dark); font-size: var(--fs-small); }
.lb-btn {
  position: absolute; display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; border: 0; border-radius: 50%;
  background: rgba(255,255,255,.1); color: #fff; cursor: pointer;
  transition: background .2s;
}
.lb-btn:hover { background: var(--red); }
.lb-btn svg { width: 22px; height: 22px; }
.lb-close { top: 1rem; right: 1rem; }
.lb-prev { left: 1rem; top: 50%; transform: translateY(-50%); }
.lb-next { right: 1rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 640px) {
  .lightbox { padding: 4rem .75rem 5.5rem; }
  .lb-prev, .lb-next { top: auto; bottom: 1rem; transform: none; }
  .lb-prev { left: 1rem; } .lb-next { right: 1rem; }
  .lightbox-caption { bottom: 2rem; padding-inline: 5rem; }
}

/* ---------- Videos page ---------- */
.video-stage { padding-block: clamp(2.5rem, 5vw, 4rem); }
.player-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}
.player-frame { background: #000; box-shadow: 0 24px 60px rgba(0,0,0,.45); }
.player-frame video, .player-frame iframe { display: block; width: 100%; aspect-ratio: 16 / 9; background: #000; border: 0; }
.video-list li[hidden] { display: none; }
.player-info h2 { font-size: clamp(1.6rem, 2.6vw, 2.2rem); margin-bottom: .5rem; }
.player-info .eyebrow { margin-bottom: .75rem; }
.player-client { color: var(--red-soft); font-weight: 600; margin-bottom: 1rem; }
.player-info p { color: var(--on-dark); }
.player-meta { font-size: var(--fs-small); color: var(--on-dark-muted) !important; margin: 0; }
@media (max-width: 900px) { .player-layout { grid-template-columns: 1fr; } }

.video-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(1.25rem, 2.5vw, 2rem);
}
@media (max-width: 900px) { .video-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .video-list { grid-template-columns: 1fr; } }

.video-card {
  display: flex; flex-direction: column; gap: 1rem; width: 100%;
  padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
}
.video-thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--ink); }
.video-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease), opacity .3s; }
.video-card:hover .video-thumb img { transform: scale(1.04); }
.video-card:hover .play-badge { background: var(--red); transform: translate(-50%, -50%) scale(1.08); }
.video-dur {
  position: absolute; right: .6rem; bottom: .6rem;
  padding: .15rem .5rem; background: rgba(0,0,0,.75); color: #fff;
  font-size: var(--fs-tiny); font-weight: 600; border-radius: 3px;
}
.now-playing {
  position: absolute; left: 0; top: 0; display: none;
  padding: .35rem .75rem; background: var(--red); color: #fff;
  font-size: var(--fs-tiny); font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
}
.video-card[aria-pressed="true"] .now-playing { display: block; }
.video-card[aria-pressed="true"] .video-thumb { outline: 3px solid var(--red); outline-offset: 3px; }
.video-card[aria-pressed="true"] .play-badge { opacity: 0; }
.video-text { display: flex; flex-direction: column; gap: .25rem; }
.video-cat { font-size: var(--fs-tiny); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--red-dark); }
.video-title { font-size: 1.1875rem; font-weight: 600; color: var(--ink); line-height: 1.3; letter-spacing: -0.01em; }
.video-client { font-size: var(--fs-small); color: var(--muted); }

/* Videos call-out used on Home and Work pages */
.video-callout {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  align-items: center; gap: clamp(1.5rem, 4vw, 3rem);
  background: var(--navy); color: var(--on-dark); text-decoration: none;
}
.video-callout:hover { color: var(--on-dark); }
.video-callout .video-thumb { aspect-ratio: 16 / 9; }
.video-callout-text { padding: clamp(1.5rem, 4vw, 2.5rem) clamp(1.5rem, 4vw, 2.5rem) clamp(1.5rem, 4vw, 2.5rem) 0; }
.video-callout h2, .video-callout h3 { color: #fff; margin-bottom: .6rem; }
.video-callout p { margin-bottom: 1.25rem; }
.video-callout:hover .play-badge { background: var(--red); transform: translate(-50%, -50%) scale(1.08); }
@media (max-width: 760px) {
  .video-callout { grid-template-columns: 1fr; }
  .video-callout-text { padding: 0 1.5rem 1.75rem; }
}

/* ---------- Contact ---------- */
.contact-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.25rem; }
.contact-card {
  display: flex; flex-direction: column; gap: .4rem;
  padding: 1.75rem; background: var(--paper); border: 1px solid var(--line);
  text-decoration: none; color: var(--text);
  transition: border-color .2s, transform .2s var(--ease), box-shadow .2s;
}
.contact-card:hover { border-color: var(--red); transform: translateY(-3px); box-shadow: var(--shadow); color: var(--text); }
.contact-card .icon { width: 36px; height: 36px; color: var(--red); margin-bottom: .75rem; }
.contact-card span { font-size: var(--fs-tiny); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.contact-card strong { font-size: 1.25rem; color: var(--ink); word-break: break-word; }
@media (max-width: 860px) { .contact-cards { grid-template-columns: 1fr; } }

.form { display: grid; gap: 1.1rem; }
.form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.1rem; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: .4rem; min-width: 0; }
.field input, .field select, .field textarea { width: 100%; max-width: 100%; }
.field label { font-size: var(--fs-small); font-weight: 600; color: var(--ink); }
.field input, .field select, .field textarea {
  min-height: 48px; padding: .75rem .9rem;
  border: 1px solid #B9BCC3; border-radius: var(--radius); background: #fff;
}
.field textarea { min-height: 140px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--navy); box-shadow: 0 0 0 3px rgba(27,43,71,.15); }
.form-actions { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: .5rem; }
.form-note { font-size: var(--fs-tiny); color: var(--muted); margin: 0; }

.address-block { display: grid; gap: 1.25rem; }
.address-block div span { display: block; font-size: var(--fs-tiny); font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--red-soft); }
.map-frame { width: 100%; aspect-ratio: 16 / 10; border: 0; filter: grayscale(.3); }

/* ---------- CTA band ---------- */
.cta-band {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1.5rem 3rem;
}
.cta-band h2 { margin: 0; max-width: 18ch; }
.cta-band .hero-actions { flex-shrink: 1; min-width: 0; }

/* ---------- Reveal on scroll ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
