/* =========================================
   CSS Reset & Base
   ========================================= */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  /* LawInc Brand Tokens */
  --color-primary-start: #D4A574;
  --color-primary-end: #9B7A4F;
  --gradient-primary: linear-gradient(90deg, #D4A574, #9B7A4F);
  --color-espresso: #3C2415;
  --color-sand: #F5E6D3;
  --color-cream: #FBF7F0;
  --color-taupe: #7A6449;
  --color-table-header: #5C4033;
  --color-success: #10B981;
  --color-success-light: rgba(16, 185, 129, 0.08);
  --color-success-border: rgba(16, 185, 129, 0.2);
  --color-white: #FFFFFF;

  --font-heading: 'Bebas Neue', sans-serif;
  --font-body: 'Inter', sans-serif;

  --shadow-card: 0 2px 20px rgba(60, 36, 21, 0.06);
  --shadow-card-hover: 0 8px 32px rgba(60, 36, 21, 0.1);
  --shadow-btn: 0 4px 12px rgba(212, 165, 116, 0.15);
  --shadow-btn-hover: 0 8px 24px rgba(212, 165, 116, 0.25);

  --radius-card: 12px;
  --radius-btn: 50px;
  --radius-input: 8px;

  --max-width: 960px;
  --max-width-wide: 1100px;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 500;
  color: var(--color-taupe);
  background: var(--color-cream);
  line-height: 1.6;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

/* Skip to content */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  background: var(--color-espresso);
  color: var(--color-white);
  padding: 8px 16px;
  border-radius: var(--radius-btn);
  z-index: 999;
  font-size: 0.875rem;
  font-weight: 600;
}
.skip-link:focus {
  top: 16px;
}

/* =========================================
   Header / Nav
   ========================================= */
.site-header {
  background: var(--color-white);
  border-bottom: 1px solid rgba(60, 36, 21, 0.06);
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: var(--max-width-wide);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--color-espresso);
  text-transform: uppercase;
}
.logo span {
  color: var(--color-primary-start);
  font-weight: 400;
}
.header-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 10px 24px;
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow-btn);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  border: none;
}
.header-cta:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn-hover);
}

/* =========================================
   Hero Section
   ========================================= */
.hero {
  background: var(--color-sand);
  padding: clamp(48px, 8vw, 80px) 24px clamp(40px, 6vw, 64px);
  text-align: center;
}
.hero-inner {
  max-width: 720px;
  margin: 0 auto;
}
.hero h1 {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4rem);
  color: var(--color-espresso);
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.hero p {
  font-size: clamp(1rem, 2vw, 1.125rem);
  color: var(--color-taupe);
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.65;
}

/* =========================================
   Calculator Card
   ========================================= */
.calculator-section {
  padding: 0 24px;
  margin-top: -8px;
  padding-bottom: clamp(48px, 8vw, 80px);
  background: var(--color-sand);
}
.calculator-card {
  max-width: var(--max-width);
  margin: 0 auto;
  background: var(--color-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

/* Input Section */
.calc-inputs {
  padding: clamp(28px, 4vw, 44px) clamp(24px, 4vw, 48px);
  border-bottom: 1px solid rgba(60, 36, 21, 0.06);
}
.input-group {
  margin-bottom: 32px;
}
.input-group:last-child {
  margin-bottom: 0;
}
.input-group label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-espresso);
  margin-bottom: 8px;
}
.input-group .helper-text {
  font-size: 0.8125rem;
  color: var(--color-taupe);
  margin-bottom: 12px;
  line-height: 1.5;
  opacity: 0.8;
}

/* Dollar Input */
.dollar-input-wrap {
  position: relative;
  max-width: 340px;
}
.dollar-input-wrap::before {
  content: '$';
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-espresso);
  pointer-events: none;
}
.dollar-input {
  width: 100%;
  padding: 14px 16px 14px 32px;
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--color-espresso);
  background: var(--color-cream);
  border: 2px solid rgba(60, 36, 21, 0.1);
  border-radius: var(--radius-input);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  outline: none;
}
.dollar-input:focus {
  border-color: var(--color-primary-start);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
}

/* Percentage / Slider */
.salary-control {
  display: flex;
  align-items: center;
  gap: 16px;
  max-width: 480px;
}
.slider-wrap {
  flex: 1;
  position: relative;
}
.salary-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  background: linear-gradient(90deg, #D4A574 60%, var(--color-sand) 60%);
  border-radius: 3px;
  outline: none;
  cursor: pointer;
}
.salary-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gradient-primary);
  box-shadow: 0 2px 8px rgba(155, 122, 79, 0.3);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.salary-slider::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 3px 12px rgba(155, 122, 79, 0.4);
}
.salary-slider::-moz-range-thumb {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--gradient-primary);
  box-shadow: 0 2px 8px rgba(155, 122, 79, 0.3);
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease;
}
.salary-slider::-moz-range-track {
  height: 6px;
  background: var(--color-sand);
  border-radius: 3px;
  border: none;
}
.salary-slider:focus-visible::-webkit-slider-thumb {
  outline: 3px solid rgba(212, 165, 116, 0.4);
  outline-offset: 2px;
}

.pct-input-wrap {
  position: relative;
  width: 90px;
  flex-shrink: 0;
}
.pct-input {
  width: 100%;
  padding: 12px 32px 12px 14px;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  color: var(--color-espresso);
  background: var(--color-cream);
  border: 2px solid rgba(60, 36, 21, 0.1);
  border-radius: var(--radius-input);
  text-align: center;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.pct-input:focus {
  border-color: var(--color-primary-start);
  box-shadow: 0 0 0 3px rgba(212, 165, 116, 0.15);
}
.pct-input-wrap::after {
  content: '%';
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-taupe);
  pointer-events: none;
}

/* =========================================
   Results Section
   ========================================= */
.calc-results {
  padding: clamp(28px, 4vw, 44px) clamp(24px, 4vw, 48px);
}

.results-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 32px;
}

.result-block {
  padding: 24px;
  border-radius: var(--radius-card);
  background: var(--color-cream);
}
.result-block-header {
  font-family: var(--font-heading);
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  color: var(--color-espresso);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid rgba(60, 36, 21, 0.08);
}

.result-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 8px 0;
}
.result-row:not(:last-child) {
  border-bottom: 1px solid rgba(60, 36, 21, 0.05);
}
.result-label {
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--color-taupe);
  padding-right: 12px;
}
.result-value {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-espresso);
  white-space: nowrap;
  transition: color 0.3s ease;
}
.result-value.tax {
  color: #C05621;
}

/* Savings Hero */
.savings-hero {
  background: var(--color-success-light);
  border: 2px solid var(--color-success-border);
  border-radius: var(--radius-card);
  padding: clamp(24px, 3vw, 36px);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.savings-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--color-success);
}
.savings-label {
  font-family: var(--font-heading);
  font-size: clamp(1rem, 2vw, 1.25rem);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-table-header);
  margin-bottom: 8px;
}
.savings-amount {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 3.5rem);
  color: var(--color-success);
  line-height: 1.1;
  letter-spacing: 0.01em;
  transition: transform 0.3s ease;
}
.savings-amount.bump {
  transform: scale(1.06);
}
.savings-sublabel {
  font-size: 0.8125rem;
  color: var(--color-taupe);
  margin-top: 6px;
  opacity: 0.8;
}

/* =========================================
   Educational Section
   ========================================= */
.education-section {
  padding: clamp(48px, 8vw, 80px) 24px;
  background: var(--color-white);
}
.education-inner {
  max-width: var(--max-width);
  margin: 0 auto;
}
.education-section h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--color-espresso);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 32px;
  text-align: center;
}

.edu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-bottom: 40px;
}
.edu-card {
  background: var(--color-cream);
  border-radius: var(--radius-card);
  padding: clamp(24px, 3vw, 32px);
}
.edu-card h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.125rem, 2vw, 1.5rem);
  color: var(--color-espresso);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}
.edu-card p, .edu-card li {
  font-size: 0.9375rem;
  line-height: 1.7;
  color: var(--color-taupe);
}
.edu-card ul {
  list-style: none;
  padding: 0;
}
.edu-card li {
  padding: 4px 0 4px 20px;
  position: relative;
}
.edu-card li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gradient-primary);
}

/* Worked Example */
.worked-example {
  background: var(--color-cream);
  border-radius: var(--radius-card);
  padding: clamp(28px, 3vw, 40px);
  margin-bottom: 32px;
}
.worked-example h3 {
  font-family: var(--font-heading);
  font-size: clamp(1.25rem, 2.5vw, 1.625rem);
  color: var(--color-espresso);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 20px;
}
.example-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.example-table thead th {
  background: var(--color-table-header);
  color: var(--color-white);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8125rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.example-table thead th:first-child {
  border-radius: 8px 0 0 0;
}
.example-table thead th:last-child {
  border-radius: 0 8px 0 0;
  text-align: right;
}
.example-table tbody td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(60, 36, 21, 0.06);
  color: var(--color-taupe);
}
.example-table tbody td:last-child {
  text-align: right;
  font-weight: 600;
  color: var(--color-espresso);
}
.example-table tbody tr.highlight td {
  background: var(--color-success-light);
  color: var(--color-success);
  font-weight: 700;
}
.example-table tbody tr.highlight td:first-child {
  border-radius: 0 0 0 8px;
}
.example-table tbody tr.highlight td:last-child {
  border-radius: 0 0 8px 0;
  color: var(--color-success);
}

/* IRS Note */
.irs-note {
  background: rgba(212, 165, 116, 0.08);
  border-left: 3px solid var(--color-primary-start);
  border-radius: 0 var(--radius-input) var(--radius-input) 0;
  padding: 20px 24px;
  font-size: 0.875rem;
  line-height: 1.65;
  color: var(--color-taupe);
}
.irs-note strong {
  color: var(--color-espresso);
  display: block;
  margin-bottom: 4px;
  font-size: 0.9375rem;
}

/* =========================================
   CTA Section
   ========================================= */
.cta-section {
  padding: clamp(48px, 8vw, 80px) 24px;
  background: var(--color-sand);
  text-align: center;
}
.cta-inner {
  max-width: 600px;
  margin: 0 auto;
}
.cta-section h2 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--color-espresso);
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 12px;
}
.cta-section p {
  font-size: 1.0625rem;
  color: var(--color-taupe);
  margin-bottom: 28px;
  line-height: 1.65;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--gradient-primary);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 16px 40px;
  border-radius: var(--radius-btn);
  box-shadow: var(--shadow-btn);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  cursor: pointer;
  border: none;
  text-decoration: none;
}
.cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-btn-hover);
}

/* =========================================
   Footer
   ========================================= */
.site-footer {
  background: var(--color-espresso);
  color: rgba(255, 255, 255, 0.5);
  padding: 32px 24px;
  text-align: center;
  font-size: 0.8125rem;
  line-height: 1.6;
}
.site-footer p {
  max-width: var(--max-width);
  margin: 0 auto;
}
.site-footer .disclaimer {
  margin-bottom: 12px;
  font-style: italic;
}
.site-footer a {
  color: rgba(255, 255, 255, 0.6);
  text-decoration: underline;
  text-decoration-color: rgba(255, 255, 255, 0.2);
  transition: color 0.2s ease;
}
.site-footer a:hover {
  color: rgba(255, 255, 255, 0.85);
}

/* =========================================
   Responsive
   ========================================= */
@media (max-width: 768px) {
  .results-grid {
    grid-template-columns: 1fr;
  }
  .edu-grid {
    grid-template-columns: 1fr;
  }
  .salary-control {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .pct-input-wrap {
    width: 100%;
  }
  .pct-input {
    text-align: left;
    padding-left: 14px;
  }
  .dollar-input-wrap {
    max-width: 100%;
  }
  .header-cta span.desktop-text {
    display: none;
  }
  .header-cta span.mobile-text {
    display: inline;
  }
}
@media (min-width: 769px) {
  .header-cta span.mobile-text {
    display: none;
  }
}

/* =========================================
   Animations
   ========================================= */
@media (prefers-reduced-motion: no-preference) {
  .result-value, .savings-amount {
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), color 0.3s ease;
  }
  .result-value.animate {
    animation: valueFlash 0.4s ease;
  }
  @keyframes valueFlash {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
  }
}

/* Focus visible for accessibility */
*:focus-visible {
  outline: 2px solid var(--color-primary-start);
  outline-offset: 2px;
}