/* ============================================================
   Sidub Inc. — Design System
   Single stylesheet: tokens → reset → typography → layout →
   dividers → responsive → utilities
   ============================================================ */

/* --- Tokens ------------------------------------------------ */

:root {
  /* Brand */
  --brand: #5E4778;
  --brand-hover: #4A3860;

  /* Backgrounds */
  --bg: #FDFCFA;
  --bg-alt: #F8F6F3;

  /* Text */
  --text: #1A1A1A;
  --text-secondary: #3A3A3A;
  --text-muted: #6B6B6B;

  /* Rules & borders */
  --rule: #C8C4BE;
  --rule-light: #E0DCD6;
  --nav-border: #D8D4CE;

  /* Footer (adjusted from BRAND.md #AAAAAA for WCAG AA) */
  --footer-text: #767676;

  /* Typography */
  --font-family: 'Lora', Georgia, 'Times New Roman', serif;
  --body-size: clamp(1.0625rem, 0.95rem + 0.25vw, 1.375rem);
  --h2-size: 0.8rem;
  --nav-link-size: 0.8rem;
  --footer-size: 0.7rem;
  --toggle-size: 0.68rem;

  /* Layout */
  --max-width: 960px;
  --padding-h: 48px;
  --padding-h-mobile: 28px;
  --divider-width: 72px;

  color-scheme: light;
}

/* end tokens */

/* --- Dark Mode Overrides ----------------------------------- */

[data-theme="dark"] {
  --brand: #8B72A8;
  --brand-hover: #A68EC4;

  --bg: #141216;
  --bg-alt: #1A181E;

  --text: #E8E6EA;
  --text-secondary: #B8B4BC;
  --text-muted: #706C76;

  --rule: #3A3640;
  --rule-light: #2A2630;
  --nav-border: #2E2A34;

  /* Footer (adjusted from BRAND.md #5A5660 for WCAG AA) */
  --footer-text: #908C96;

  color-scheme: dark;
}

/* end dark mode overrides */

/* --- Reset ------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img,
svg {
  display: block;
  max-width: 100%;
}

button {
  font: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

a {
  color: inherit;
  text-decoration: none;
}

/* end reset */

/* --- Base Typography --------------------------------------- */

html {
  font-family: var(--font-family);
  font-size: 100%;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
  scroll-behavior: smooth;
}

body {
  font-size: var(--body-size);
}

h1 {
  font-size: clamp(1.8rem, 1.2rem + 2.5vw, 2.8rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.2;
  color: var(--text);
}

h2 {
  font-size: var(--h2-size);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
  margin-bottom: 0.875rem;
}

p {
  margin-bottom: 1.5em;
  color: var(--text-secondary);
}

.practice-name {
  font-size: 1.1rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--text);
}

.practice-brief {
  font-size: 0.85rem;
  font-weight: 400;
  font-style: italic;
  color: var(--text-secondary);
  display: block;
  margin-top: 8px;
}

.cta {
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
}

.philosophy-text {
  font-size: 1.15rem;
  line-height: 1.75;
  color: var(--text-secondary);
  margin-bottom: 0;
}

/* end typography */

/* --- Layout ------------------------------------------------ */

.container {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--padding-h);
  padding-right: var(--padding-h);
}

main {
  padding-top: 8vh;
  padding-bottom: 10vh;
}

section {
  margin-bottom: clamp(3rem, 5vh, 5rem);
}

section:last-child {
  margin-bottom: 0;
}

/* end layout */

/* --- Dividers ---------------------------------------------- */

.divider {
  width: var(--divider-width);
  height: 1px;
  background-color: var(--rule);
  border: none;
  margin: 4vh auto;
}

/* end dividers */

/* --- Responsive -------------------------------------------- */

@media (max-width: 768px) {
  .container {
    padding-left: var(--padding-h-mobile);
    padding-right: var(--padding-h-mobile);
  }
}

/* end responsive */

/* --- Utilities --------------------------------------------- */

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* end utilities */

/* --- Navigation -------------------------------------------- */

.nav {
  border-bottom: 1px solid var(--nav-border);
}

.nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin-left: auto;
  margin-right: auto;
  padding: 1.5rem var(--padding-h);
}

.nav__brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--brand);
  text-decoration: none;
}

.nav__logo {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
}

.nav__wordmark {
  font-family: var(--font-family);
  font-size: 1rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.2em;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__link {
  font-size: var(--nav-link-size);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
}

.nav__link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.nav__link[aria-current="page"] {
  color: var(--text);
  font-weight: 500;
}

/* end navigation */

/* --- Dark Mode Toggle -------------------------------------- */

.nav__toggle {
  font-family: var(--font-family);
  font-size: var(--toggle-size);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  padding: 0.3rem 0.6rem;
  border: 1px solid var(--rule-light);
  border-radius: 2px;
  background: none;
  cursor: pointer;
}

.nav__toggle:hover {
  color: var(--text);
  border-color: var(--text-muted);
}

/* end dark mode toggle */

/* --- Footer ------------------------------------------------ */

.footer {
  border-top: 1px solid var(--nav-border);
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.footer__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.footer__copyright {
  font-size: var(--footer-size);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--footer-text);
}

.footer__link {
  font-size: var(--footer-size);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--footer-text);
  text-decoration: none;
}

.footer__link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* end footer */

/* --- Skip Link --------------------------------------------- */

.skip-link {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  padding: 0.5rem 1rem;
  background: var(--bg);
  color: var(--brand);
  font-size: 0.75rem;
  font-weight: 500;
  z-index: 100;
  text-decoration: underline;
}

.skip-link:focus {
  top: 0.5rem;
}

/* end skip link */

/* --- Home Page --------------------------------------------- */

.hero {
  min-height: calc(100vh - 8vh);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4vh;
  padding-bottom: 9vh;
}

.practice-area {
  display: block;
  text-decoration: none;
  padding: 24px 0;
}

.practice-area:hover .practice-name {
  color: var(--brand);
}

.practice-area:hover .practice-name::after {
  content: " \2192";
}

.divider--light {
  background-color: var(--rule-light);
}

/* end home page */

/* --- Partner Badges ---------------------------------------- */

.partner-badges {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(2rem, 4vw, 3.5rem);
  flex-wrap: wrap;
  margin-bottom: 0;
}

.partner-badges__img {
  height: 28px;
  width: auto;
  opacity: 0.45;
  filter: grayscale(100%);
  transition: opacity 0.2s ease, filter 0.2s ease;
}

.partner-badges__img:hover {
  opacity: 0.7;
  filter: grayscale(0%);
}

[data-theme="dark"] .partner-badges__img {
  filter: grayscale(100%) invert(1);
  opacity: 0.4;
}

[data-theme="dark"] .partner-badges__img:hover {
  filter: invert(1);
  opacity: 0.65;
}

/* end partner badges */

/* --- Inner Pages ------------------------------------------- */

.page-intro h1 {
  font-size: clamp(1.6rem, 1.0rem + 2vw, 2.3rem);
  margin-bottom: 1.5rem;
}

address p {
  margin-bottom: 0.75rem;
}

address a {
  color: var(--brand);
}

address a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--brand-hover);
}

.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2.5rem 4rem;
  font-style: normal;
}

.contact-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.contact-item span,
.contact-item a {
  font-size: var(--body-size);
  color: var(--text-secondary);
}

.contact-item a {
  color: var(--brand);
}

.contact-label {
  font-size: var(--h2-size);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--text-muted);
}

/* end inner pages */

/* --- Mobile Navigation ------------------------------------- */

@media (max-width: 960px) {
  .contact-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .nav__inner {
    flex-direction: column;
    gap: 0.75rem;
    position: relative;
    padding-top: 1rem;
    padding-bottom: 1rem;
  }

  .nav__brand {
    justify-content: center;
  }

  .nav__links {
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem;
  }

  .nav__toggle {
    position: absolute;
    top: 1rem;
    right: var(--padding-h-mobile);
  }

  .footer__inner {
    flex-direction: column;
    gap: 0.5rem;
    text-align: center;
  }
}

/* end mobile navigation */

/* --- Accessibility ----------------------------------------- */

a:focus-visible,
button:focus-visible {
  outline: none;
  text-decoration: underline;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 3px;
  text-underline-offset: 4px;
}

.skip-link:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
  text-decoration: none;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto !important;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* end accessibility */

/* --- Print ------------------------------------------------- */

@media print {
  /* Force light mode colors on both :root and dark theme */
  :root,
  [data-theme="dark"] {
    --bg: #FDFCFA;
    --bg-alt: #F8F6F3;
    --text: #1A1A1A;
    --text-secondary: #3A3A3A;
    --text-muted: #6B6B6B;
    --rule: #C8C4BE;
    --rule-light: #E0DCD6;
    --brand: #5E4778;
    --footer-text: #767676;
    color-scheme: light;
  }

  /* Hide navigation chrome */
  .nav,
  .footer,
  .skip-link {
    display: none !important;
  }

  /* Remove main vertical padding (no nav to clear) */
  main {
    padding-top: 2rem;
  }

  /* Page break handling */
  section {
    page-break-inside: avoid;
  }

  address {
    page-break-inside: avoid;
  }
}

/* end print */
