/* ============================================================
   HICKSON LAW GROUP — Design Tokens & Component Styles
   Navy & Warm Gold / Authoritative & Accessible
   ============================================================ */

/* ---------- Type Scale (fluid) ---------- */
:root {
  --text-xs:   clamp(0.8125rem, 0.75rem + 0.3vw, 0.9375rem);   /* 13→15 */
  --text-sm:   clamp(0.9375rem, 0.875rem + 0.35vw, 1.0625rem);  /* 15→17 */
  --text-base: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);       /* 17→19 — larger for elderly */
  --text-lg:   clamp(1.25rem, 1.1rem + 0.75vw, 1.625rem);       /* 20→26 */
  --text-xl:   clamp(1.625rem, 1.3rem + 1.25vw, 2.5rem);        /* 26→40 */
  --text-2xl:  clamp(2.25rem, 1.4rem + 2.5vw, 3.75rem);         /* 36→60 */

  /* Fonts */
  --font-display: 'Playfair Display', Georgia, serif;
  --font-body: 'DM Sans', 'Helvetica Neue', Arial, sans-serif;

  /* 4px spacing system */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-32: 8rem;

  /* Radius */
  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  /* Transitions */
  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Content widths */
  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
}

/* ---------- Light Mode (Default) ---------- */
:root, [data-theme="light"] {
  --color-bg:             #f8f7f4;
  --color-surface:        #ffffff;
  --color-surface-2:      #f2f1ed;
  --color-surface-offset: #eceae5;
  --color-divider:        #d9d5ce;
  --color-border:         #c8c3ba;

  --color-text:           #1a1a2e;
  --color-text-muted:     #5a5a6e;
  --color-text-faint:     #9a99a8;
  --color-text-inverse:   #f8f7f4;

  /* Primary — Navy */
  --color-primary:        #1b3a5c;
  --color-primary-hover:  #142d48;
  --color-primary-active: #0e2035;
  --color-primary-light:  #e8edf3;

  /* Accent — Warm Gold */
  --color-accent:         #b8860b;
  --color-accent-hover:   #9a7009;
  --color-accent-light:   #fdf5e6;

  /* Success */
  --color-success:        #2e7d32;
  --color-success-light:  #e8f5e9;

  /* Error */
  --color-error:          #c62828;
  --color-error-light:    #fce4ec;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(27, 58, 92, 0.06);
  --shadow-md: 0 4px 12px rgba(27, 58, 92, 0.08);
  --shadow-lg: 0 12px 32px rgba(27, 58, 92, 0.12);
}

/* ---------- Dark Mode ---------- */
[data-theme="dark"] {
  --color-bg:             #111827;
  --color-surface:        #1e293b;
  --color-surface-2:      #283548;
  --color-surface-offset: #1a2332;
  --color-divider:        #334155;
  --color-border:         #475569;

  --color-text:           #e2e8f0;
  --color-text-muted:     #94a3b8;
  --color-text-faint:     #64748b;
  --color-text-inverse:   #111827;

  --color-primary:        #7dacce;
  --color-primary-hover:  #93bfde;
  --color-primary-active: #a8d0ec;
  --color-primary-light:  #1e2d3d;

  --color-accent:         #daa520;
  --color-accent-hover:   #e6b84a;
  --color-accent-light:   #2a2518;

  --color-success:        #66bb6a;
  --color-success-light:  #1a2e1b;

  --color-error:          #ef5350;
  --color-error-light:    #2e1a1a;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    --color-bg:             #111827;
    --color-surface:        #1e293b;
    --color-surface-2:      #283548;
    --color-surface-offset: #1a2332;
    --color-divider:        #334155;
    --color-border:         #475569;
    --color-text:           #e2e8f0;
    --color-text-muted:     #94a3b8;
    --color-text-faint:     #64748b;
    --color-text-inverse:   #111827;
    --color-primary:        #7dacce;
    --color-primary-hover:  #93bfde;
    --color-primary-active: #a8d0ec;
    --color-primary-light:  #1e2d3d;
    --color-accent:         #daa520;
    --color-accent-hover:   #e6b84a;
    --color-accent-light:   #2a2518;
    --color-success:        #66bb6a;
    --color-success-light:  #1a2e1b;
    --color-error:          #ef5350;
    --color-error-light:    #2e1a1a;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.4);
  }
}

/* ============================================================
   GLOBAL COMPONENTS
   ============================================================ */

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-4);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 600;
  z-index: 1000;
  text-decoration: none;
}
.skip-link:focus {
  top: var(--space-2);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: oklch(from var(--color-bg) l c h / 0.95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-divider);
  transition: box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.site-header--scrolled {
  box-shadow: var(--shadow-sm);
}

.header-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  padding: var(--space-4) var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}

.logo-link {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  color: var(--color-text);
}
.logo-link:hover { opacity: 0.85; }

.logo-text {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  line-height: 1.1;
  color: var(--color-primary);
}
.logo-text span {
  display: block;
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--color-accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-top: var(--space-1);
}

/* ---------- Navigation ---------- */
.main-nav {
  display: flex;
  align-items: center;
  gap: var(--space-6);
}

.nav-links {
  display: flex;
  gap: var(--space-6);
  list-style: none;
}

.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  color: var(--color-text-muted);
  padding: var(--space-2) 0;
  position: relative;
}
.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--color-accent);
  transition: width var(--transition-interactive);
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--color-primary);
}
.nav-links a:hover::after,
.nav-links a.active::after {
  width: 100%;
}

.nav-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-5);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  text-decoration: none;
  min-height: 44px;
}
.nav-cta:hover {
  background: var(--color-primary-hover);
}

/* Hamburger */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: var(--space-2);
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
}
.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text);
  transition: all 0.3s;
}
.menu-toggle[aria-expanded="true"] span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
.menu-toggle[aria-expanded="true"] span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  color: var(--color-text-muted);
  border-radius: var(--radius-md);
}
.theme-toggle:hover {
  color: var(--color-primary);
  background: var(--color-primary-light);
}

/* ---------- Phone bar ---------- */
.phone-bar {
  background: var(--color-primary);
  color: var(--color-text-inverse);
  text-align: center;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  font-weight: 500;
}
.phone-bar a {
  color: var(--color-text-inverse);
  text-decoration: none;
  font-weight: 700;
}
.phone-bar a:hover {
  text-decoration: underline;
}

/* ---------- Hero ---------- */
.hero {
  padding: clamp(var(--space-16), 10vw, var(--space-32)) var(--space-6);
  text-align: center;
  background: var(--color-primary);
  color: var(--color-text-inverse);
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(27,58,92,0.95), rgba(14,32,53,0.9));
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--content-default);
  margin: 0 auto;
}
.hero h1 {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  margin-bottom: var(--space-6);
  color: #ffffff;
}
.hero p {
  font-size: var(--text-lg);
  max-width: 56ch;
  margin: 0 auto var(--space-8);
  opacity: 0.9;
  line-height: 1.7;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: 600;
  padding: var(--space-4) var(--space-8);
  background: var(--color-accent);
  color: #ffffff;
  border-radius: var(--radius-md);
  text-decoration: none;
  min-height: 52px;
}
.hero-cta:hover {
  background: var(--color-accent-hover);
}

/* Gold accent line under hero */
.hero-accent {
  height: 4px;
  background: linear-gradient(90deg, var(--color-accent), var(--color-accent-hover));
}

/* ---------- Sections ---------- */
.section {
  padding: clamp(var(--space-12), 8vw, var(--space-24)) var(--space-6);
}
.section--alt {
  background: var(--color-surface-2);
}

.section-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
}

.section-header {
  margin-bottom: var(--space-10);
}
.section-header h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}
.section-header p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 60ch;
}

/* ---------- Services grid ---------- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-6);
}

.service-card {
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition-interactive),
              transform var(--transition-interactive);
}
.service-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
}

.service-icon {
  width: 48px;
  height: 48px;
  color: var(--color-accent);
  margin-bottom: var(--space-4);
}

.service-card h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}
.service-card p {
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ---------- Trust indicators ---------- */
.trust-bar {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-8);
  padding: var(--space-8) var(--space-6);
  background: var(--color-surface-2);
  border-top: 1px solid var(--color-divider);
  border-bottom: 1px solid var(--color-divider);
}
.trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
}
.trust-item svg {
  width: 24px;
  height: 24px;
  color: var(--color-accent);
  flex-shrink: 0;
}

/* ---------- Bio section ---------- */
.bio-layout {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--space-10);
  align-items: start;
}

img.bio-photo {
  width: 100%;
  height: auto;
  aspect-ratio: 3/4;
  object-fit: cover;
  object-position: top center;
  border-radius: var(--radius-lg);
  background: var(--color-surface-2);
}

.bio-content h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}
.bio-content .bio-title {
  font-size: var(--text-base);
  color: var(--color-accent);
  font-weight: 600;
  margin-bottom: var(--space-6);
}
.bio-content p {
  color: var(--color-text);
  line-height: 1.8;
  margin-bottom: var(--space-4);
}

.credentials {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-6);
}
.credential-tag {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary-light);
  color: var(--color-primary);
  border-radius: var(--radius-full);
}

/* ---------- Contact / Form ---------- */
.contact-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-10);
  align-items: start;
}

.contact-info h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-4);
}

.contact-detail {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  font-size: var(--text-base);
  color: var(--color-text);
}
.contact-detail svg {
  width: 24px;
  height: 24px;
  color: var(--color-accent);
  flex-shrink: 0;
  margin-top: 2px;
}
.contact-detail a {
  color: var(--color-primary);
  text-decoration: none;
}
.contact-detail a:hover {
  text-decoration: underline;
}

/* Email reveal */
.email-reveal {
  color: var(--color-primary);
  text-decoration: none;
  cursor: pointer;
  border-bottom: 1px dashed var(--color-primary);
  padding-bottom: 1px;
}
.email-reveal:hover {
  color: var(--color-primary-hover);
  border-bottom-color: var(--color-primary-hover);
}

/* Form */
.form-group {
  margin-bottom: var(--space-5);
}
.form-group label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-base);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-text);
  min-height: 48px;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  border-color: var(--color-primary);
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}
.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.form-note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-3);
  line-height: 1.6;
}

.btn-submit {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-base);
  font-weight: 600;
  padding: var(--space-4) var(--space-8);
  background: var(--color-primary);
  color: var(--color-text-inverse);
  border-radius: var(--radius-md);
  border: none;
  cursor: pointer;
  min-height: 52px;
  width: 100%;
  justify-content: center;
}
.btn-submit:hover {
  background: var(--color-primary-hover);
}

.form-success {
  display: none;
  padding: var(--space-4);
  background: var(--color-success-light);
  border-radius: var(--radius-md);
  color: var(--color-success);
  font-weight: 600;
  text-align: center;
  margin-top: var(--space-4);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--color-primary);
  color: rgba(255,255,255,0.85);
  padding: var(--space-12) var(--space-6) var(--space-6);
}
.footer-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-10);
}

.footer-brand .logo-text {
  color: #ffffff;
  margin-bottom: var(--space-3);
}
.footer-brand .logo-text span {
  color: var(--color-accent);
}
.footer-brand p {
  font-size: var(--text-sm);
  max-width: 36ch;
  line-height: 1.7;
  opacity: 0.8;
}

.footer-links h4 {
  font-size: var(--text-sm);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: var(--space-4);
  color: rgba(255,255,255,0.6);
}
.footer-links ul {
  list-style: none;
}
.footer-links li {
  margin-bottom: var(--space-2);
}
.footer-links a {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.8);
  text-decoration: none;
}
.footer-links a:hover {
  color: #ffffff;
}

.footer-bottom {
  max-width: var(--content-wide);
  margin: var(--space-8) auto 0;
  padding-top: var(--space-6);
  border-top: 1px solid rgba(255,255,255,0.15);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-xs);
  opacity: 0.6;
}

/* ---------- Page headers (interior) ---------- */
.page-header {
  background: var(--color-primary);
  color: #ffffff;
  padding: clamp(var(--space-10), 6vw, var(--space-16)) var(--space-6);
  text-align: center;
}
.page-header h1 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  margin-bottom: var(--space-3);
}
.page-header p {
  font-size: var(--text-base);
  opacity: 0.85;
  max-width: 50ch;
  margin: 0 auto;
}

/* ---------- Breadcrumb ---------- */
.breadcrumb {
  font-size: var(--text-xs);
  padding: var(--space-3) var(--space-6);
  background: var(--color-surface-2);
}
.breadcrumb-inner {
  max-width: var(--content-wide);
  margin: 0 auto;
  display: flex;
  gap: var(--space-2);
}
.breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
}
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb span { color: var(--color-text-faint); }

/* ---------- Services detail list ---------- */
.services-detail {
  display: grid;
  gap: var(--space-8);
}

.service-detail-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: var(--space-5);
  align-items: start;
}
.service-detail-item .detail-number {
  width: 48px;
  height: 48px;
  background: var(--color-accent);
  color: #ffffff;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  border-radius: var(--radius-full);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.service-detail-item h3 {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-2);
}
.service-detail-item p {
  color: var(--color-text-muted);
  line-height: 1.7;
}

/* ---------- CTA banner ---------- */
.cta-banner {
  background: var(--color-accent-light);
  text-align: center;
  padding: var(--space-12) var(--space-6);
}
.cta-banner h2 {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}
.cta-banner p {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  max-width: 50ch;
  margin: 0 auto var(--space-6);
}
.cta-banner .hero-cta {
  background: var(--color-primary);
}
.cta-banner .hero-cta:hover {
  background: var(--color-primary-hover);
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
  .menu-toggle { display: flex; }

  .main-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: #f8f7f4;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: var(--space-6);
    z-index: 9999;
    padding: var(--space-10) var(--space-6);
    overflow-y: auto;
  }
  [data-theme="dark"] .main-nav {
    background: #1a1a1a;
  }
  .main-nav.open {
    display: flex;
  }
  .nav-links {
    flex-direction: column;
    align-items: center;
    gap: var(--space-6);
  }
  .nav-links a {
    font-size: var(--text-xl);
  }
  .menu-toggle {
    position: relative;
    z-index: 10000;
  }

  .bio-layout {
    grid-template-columns: 1fr;
  }
  .bio-photo {
    max-width: 280px;
    margin: 0 auto;
  }

  .contact-layout {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: var(--space-8);
  }
  .footer-bottom {
    flex-direction: column;
    gap: var(--space-2);
    text-align: center;
  }

  .services-grid {
    grid-template-columns: 1fr;
  }

  .trust-bar {
    gap: var(--space-4);
  }

  .logo-text span {
    font-size: 0.625rem;
    letter-spacing: 0.08em;
  }
}
