/* ==========================================================================
   KB Law Office — Stylesheet
   ========================================================================== */

:root {
  --navy: #0F172A;
  --navy-soft: #16213a;
  --royal: #1D4ED8;
  --royal-light: #3b6ff0;
  --gold: #D4AF37;
  --gold-soft: rgba(212, 175, 55, 0.14);
  --bg: #FFFFFF;
  --bg-alt: #F8FAFC;
  --charcoal: #1F2937;
  --muted: #5B6472;
  --line: #E6E9EF;
  --white: #FFFFFF;

  --font-head: 'Poppins', sans-serif;
  --font-body: 'Inter', sans-serif;

  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;

  --shadow-sm: 0 2px 10px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 12px 32px rgba(15, 23, 42, 0.09);
  --shadow-lg: 0 24px 60px rgba(15, 23, 42, 0.14);

  --ease: cubic-bezier(.22,.61,.36,1);
  --container: 1180px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

body {
  font-family: var(--font-body);
  color: var(--charcoal);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-head); color: var(--navy); font-weight: 600; line-height: 1.2; }

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; }
button { font: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font: inherit; }

.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--navy); color: var(--white);
  padding: 12px 18px; z-index: 999; border-radius: 0 0 8px 0;
}
.skip-link:focus { left: 0; }

:focus-visible {
  outline: 2px solid var(--gold);
  outline-offset: 3px;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-content: center;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 14px 26px;
  border-radius: 999px;
  overflow: hidden;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), background 0.35s var(--ease), color .35s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--royal), #1a3fc4);
  color: var(--white);
  box-shadow: 0 10px 24px rgba(29, 78, 216, 0.32);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(29, 78, 216, 0.4); }
.btn-outline {
  background: transparent;
  color: var(--navy);
  border: 1.5px solid var(--line);
}
.btn-outline:hover { border-color: var(--royal); color: var(--royal); transform: translateY(-2px); }
.btn-small { padding: 10px 20px; font-size: 0.85rem; }
.btn-full { width: 100%; }

.btn .ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.55);
  transform: scale(0);
  animation: ripple 0.6s var(--ease);
  pointer-events: none;
}
.btn-outline .ripple { background: rgba(29,78,216,0.18); }
@keyframes ripple {
  to { transform: scale(3); opacity: 0; }
}

/* ---------- Header / Nav ---------- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.75);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.3s var(--ease), box-shadow 0.3s var(--ease), background 0.3s var(--ease);
}
.site-header.scrolled {
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}

.nav {
  max-width: var(--container);
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo { display: flex; align-items: center; }
.logo-svg {
  height: 40px;
  width: auto;
  display: block;
  transition: opacity 0.25s var(--ease);
}
.logo:hover .logo-svg { opacity: 0.85; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 34px;
}
.nav-link {
  position: relative;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--charcoal);
  padding: 6px 0;
  transition: color 0.25s var(--ease);
}
.nav-link::after {
  content: '';
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--gold);
  transition: width 0.3s var(--ease);
}
.nav-link:hover, .nav-link.active { color: var(--royal); }
.nav-link:hover::after, .nav-link.active::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 16px; }

.hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px; height: 40px;
  border-radius: 8px;
}
.hamburger span {
  width: 22px; height: 2px;
  background: var(--navy);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
  margin: 0 auto;
}
.hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  padding: 168px 0 100px;
  background: var(--navy);
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(600px 400px at 85% 10%, rgba(29,78,216,0.35), transparent 70%),
    radial-gradient(500px 400px at 10% 90%, rgba(212,175,55,0.08), transparent 70%);
  pointer-events: none;
}
.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  align-items: center;
  gap: 48px;
  position: relative;
  z-index: 1;
}
.eyebrow {
  font-family: var(--font-head);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 18px;
}
.eyebrow.center { text-align: center; }
.hero-title {
  font-size: clamp(2.3rem, 4.6vw, 3.6rem);
  color: var(--white);
  letter-spacing: -0.01em;
  margin-bottom: 22px;
}
.hero-sub {
  font-size: 1.08rem;
  color: rgba(248,250,252,0.72);
  max-width: 46ch;
  margin-bottom: 36px;
}
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; margin-bottom: 56px; }
.hero .btn-outline { color: var(--white); border-color: rgba(248,250,252,0.28); }
.hero .btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.hero-stats {
  display: flex;
  gap: 40px;
  flex-wrap: wrap;
}
.hero-stats dt {
  font-family: var(--font-head);
  font-size: 2rem;
  font-weight: 700;
  color: var(--white);
}
.hero-stats dt::after { content: '+'; color: var(--gold); }
.hero-stats dd {
  font-size: 0.85rem;
  color: rgba(248,250,252,0.6);
  margin-top: 2px;
}

.hero-art { display: flex; align-items: center; justify-content: center; }
.hero-illustration { width: 100%; max-width: 460px; height: auto; }

.beam-group { transform-origin: 260px 120px; animation: tilt 4.5s ease-in-out infinite; }
@keyframes tilt {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(2.2deg); }
}
.pan-left { animation: panL 4.5s ease-in-out infinite; transform-origin: 120px 120px; }
.pan-right { animation: panR 4.5s ease-in-out infinite; transform-origin: 400px 120px; }
@keyframes panL { 0%,100% { transform: translateY(0); } 50% { transform: translateY(6px); } }
@keyframes panR { 0%,100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
.doc-float { animation: floaty 5s ease-in-out infinite; }
.building-float { animation: floaty 6s ease-in-out infinite reverse; }
@keyframes floaty { 0%,100% { transform: translate(330px,250px); } 50% { transform: translate(330px,240px); } }

.hero-fade {
  position: absolute; bottom: 0; left: 0; right: 0; height: 90px;
  background: linear-gradient(to bottom, transparent, var(--bg));
}

/* ---------- Sections (generic) ---------- */
.section { padding: 100px 0; }
.section-alt { background: var(--bg-alt); }
.section-title {
  font-size: clamp(1.7rem, 3vw, 2.3rem);
  margin-bottom: 14px;
}
.section-title.center { text-align: center; }
.section-sub {
  color: var(--muted);
  font-size: 1.02rem;
  max-width: 56ch;
  margin: 0 auto 56px;
}
.section-sub.center { text-align: center; }

.grid { display: grid; gap: 24px; }

/* ---------- Practice Area Cards ---------- */
.practice-grid { grid-template-columns: repeat(3, 1fr); }
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease), border-color .35s var(--ease);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: rgba(29,78,216,0.25);
}
.card-icon {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: var(--gold-soft);
  color: var(--royal);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 20px;
  transition: background .35s var(--ease), transform .35s var(--ease);
}
.card-icon svg { width: 26px; height: 26px; }
.card:hover .card-icon { background: var(--royal); color: var(--white); transform: scale(1.06) rotate(-4deg); }
.card h3 { font-size: 1.08rem; margin-bottom: 10px; }
.card p { color: var(--muted); font-size: 0.94rem; }

/* ---------- Why Choose Us ---------- */
.feature-grid { grid-template-columns: repeat(3, 1fr); gap: 4px 40px; }
.feature { padding: 28px 4px; border-bottom: 1px solid var(--line); }
.feature-icon {
  width: 44px; height: 44px;
  color: var(--royal);
  margin-bottom: 16px;
}
.feature-icon svg { width: 100%; height: 100%; }
.feature h3 { font-size: 1.03rem; margin-bottom: 8px; }
.feature p { color: var(--muted); font-size: 0.92rem; }

/* ---------- Timeline ---------- */
.timeline {
  position: relative;
  max-width: 760px;
  margin: 0 auto;
  padding-left: 8px;
}
.timeline::before {
  content: '';
  position: absolute;
  left: 27px; top: 8px; bottom: 8px;
  width: 2px;
  background: linear-gradient(to bottom, var(--gold), var(--line) 90%);
}
.timeline-item {
  display: flex;
  gap: 26px;
  padding: 22px 0;
  position: relative;
}
.timeline-index {
  flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.95rem;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
  box-shadow: 0 0 0 6px var(--bg);
}
.timeline-body h3 { font-size: 1.08rem; margin-bottom: 6px; padding-top: 8px; }
.timeline-body p { color: var(--muted); font-size: 0.94rem; }

/* ---------- Testimonials ---------- */
.testimonial-grid { grid-template-columns: repeat(3, 1fr); }
.testimonial-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 32px 28px;
  transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
}
.testimonial-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.testimonial-card blockquote {
  color: var(--charcoal);
  font-size: 0.98rem;
  line-height: 1.7;
  margin-bottom: 24px;
}
.testimonial-card figcaption { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--navy);
  color: var(--gold);
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 0.85rem;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.testimonial-card .name { display: block; font-weight: 600; font-family: var(--font-head); font-size: 0.92rem; color: var(--navy); }
.testimonial-card .role { display: block; font-size: 0.82rem; color: var(--muted); }

/* ---------- Contact ---------- */
.contact-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 48px;
  align-items: start;
}
.contact-form {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-sm);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.field { margin-bottom: 20px; }
.field label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 8px;
  font-family: var(--font-head);
}
.field input, .field select, .field textarea {
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-alt);
  color: var(--charcoal);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
  resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--royal);
  background: var(--white);
}
.field.invalid input, .field.invalid select, .field.invalid textarea {
  border-color: #DC2626;
}
.field-error {
  display: block;
  font-size: 0.78rem;
  color: #DC2626;
  min-height: 16px;
  margin-top: 4px;
}
.form-note {
  margin-top: 16px;
  font-size: 0.9rem;
  text-align: center;
  color: var(--royal);
  min-height: 20px;
}

.contact-info { display: flex; flex-direction: column; gap: 22px; }
.info-item { display: flex; gap: 16px; align-items: flex-start; }
.info-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: var(--navy);
  color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.info-icon svg { width: 20px; height: 20px; }
.info-label { display: block; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); margin-bottom: 3px; font-weight: 600; }
.info-item a, .info-item span:not(.info-label) { font-size: 0.96rem; color: var(--charcoal); }
.info-item a:hover { color: var(--royal); }

.map-placeholder {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  height: 160px;
  margin-top: 8px;
  box-shadow: var(--shadow-sm);
}
.map-placeholder svg { width: 100%; height: 100%; }
.map-placeholder span {
  position: absolute;
  bottom: 12px; left: 14px;
  font-size: 0.78rem;
  color: rgba(248,250,252,0.7);
  font-family: var(--font-head);
}

/* ---------- Footer ---------- */
.footer {
  background: var(--navy);
  color: rgba(248,250,252,0.72);
  padding: 72px 0 0;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 56px;
  border-bottom: 1px solid rgba(248,250,252,0.1);
}
.footer .logo-svg { height: 42px; }
.footer-brand p { margin: 18px 0 22px; font-size: 0.92rem; max-width: 32ch; }
.social-icons { display: flex; gap: 12px; }
.social-icons a {
  width: 38px; height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(248,250,252,0.18);
  display: flex; align-items: center; justify-content: center;
  transition: border-color .3s var(--ease), background .3s var(--ease), transform .3s var(--ease);
}
.social-icons svg { width: 16px; height: 16px; }
.social-icons a:hover { border-color: var(--gold); background: rgba(212,175,55,0.1); transform: translateY(-2px); }

.footer-col h4 {
  color: var(--white);
  font-size: 0.9rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 18px;
}
.footer-col ul { display: flex; flex-direction: column; gap: 11px; }
.footer-col a, .footer-col li { font-size: 0.92rem; }
.footer-col a:hover { color: var(--gold); }

.footer-bottom {
  padding: 24px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.82rem;
  color: rgba(248,250,252,0.45);
  max-width: var(--container);
  margin: 0 auto;
}

/* ---------- Reveal animation ---------- */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.reveal.in-view { opacity: 1; transform: translateY(0); }

/* ---------- Responsive ---------- */
@media (max-width: 980px) {
  .hero-inner { grid-template-columns: 1fr; text-align: left; }
  .hero-art { order: -1; margin-bottom: 12px; }
  .hero-illustration { max-width: 320px; }
  .practice-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .testimonial-grid { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 760px) {
  .nav-links {
    position: fixed;
    top: 72px; left: 0; right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    background: var(--white);
    padding: 12px 24px 24px;
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    transform: translateY(-140%);
    opacity: 0;
    transition: transform 0.35s var(--ease), opacity 0.35s var(--ease);
    pointer-events: none;
  }
  .nav-links.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
  .nav-links li { width: 100%; }
  .nav-link { display: block; padding: 12px 0; width: 100%; }
  .nav-actions .btn-small { display: none; }
  .hamburger { display: flex; }
  .logo-svg { height: 32px; }

  .hero { padding: 130px 0 72px; }
  .hero-stats { gap: 26px; }

  .practice-grid, .feature-grid { grid-template-columns: 1fr; }
  .section { padding: 72px 0; }
  .section-sub { margin-bottom: 40px; }

  .form-row { grid-template-columns: 1fr; }
  .contact-form { padding: 28px 22px; }

  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-bottom { flex-direction: column; text-align: center; }
}

@media (max-width: 400px) {
  .hero-stats { gap: 18px; }
  .hero-stats dt { font-size: 1.6rem; }
}
