/* ==========================================================================
   THE REAL WORK (TRW) - DESIGN SYSTEM & TOKENS
   Founded by Myisha Jones, MSW, LCSW
   Ethos: "Do the work. Change everything."
   ========================================================================== */

/* Typography Imports */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400..800;1,400..800&family=Plus+Jakarta+Sans:ital,wght@0,300..800;1,300..800&display=swap');

/* Explicit Font Faces for Brand Fonts (Local Only - CSP Compliant) */
@font-face {
  font-family: 'CMU Serif Roman';
  font-style: normal;
  font-weight: 400;
  src: local('CMU Serif Roman'),
       local('CMUSerif-Roman'),
       local('CMU Serif');
  font-display: swap;
}

@font-face {
  font-family: 'CMU Serif Roman';
  font-style: italic;
  font-weight: 400;
  src: local('CMU Serif Italic'),
       local('CMUSerif-Italic');
  font-display: swap;
}

@font-face {
  font-family: 'CMU Serif Roman';
  font-style: normal;
  font-weight: 700;
  src: local('CMU Serif Bold'),
       local('CMUSerif-Bold');
  font-display: swap;
}

@font-face {
  font-family: 'Farmhand Regular';
  font-style: normal;
  font-weight: 400 900;
  src: local('Farmhand Regular'),
       local('Farmhand-Regular'),
       local('Farmhand'),
       local('Farmhand Serif');
  font-display: swap;
}

@font-face {
  font-family: 'Farmhand Serif';
  font-style: normal;
  font-weight: 400 900;
  src: local('Farmhand Serif'),
       local('FarmhandSerif'),
       local('Farmhand');
  font-display: swap;
}

:root {
  /* Brand Palette */
  --color-main: #f4a340;            /* Main Color: Warm Golden Amber */
  --color-main-hover: #e09332;
  --color-secondary: #B23D00;       /* Darker Terracotta / Deep Burnt Orange (AA Compliant: 5.68:1 on Cream) */
  --color-secondary-hover: #8F3100;

  /* Aliases & Semantic Tokens */
  --color-sun-core: #B23D00;        /* Core Interactive Accent (AA Compliant) */
  --color-sun-core-hover: #8F3100;
  --color-sun-arch: #f4a340;        /* Main Color */
  --color-sun-arch-hover: #e09332;
  --color-sun-arch-soft: rgba(244, 163, 64, 0.16);
  --color-sun-core-soft: rgba(178, 61, 0, 0.12);
  --color-link: #B23D00;            /* Accessible link color (AA Compliant) */
  --color-link-hover: #8F3100;
  --color-phone: #B23D00;           /* Phone link & bubble icon color */
  --color-phone-hover: #8F3100;
  --color-canvas: #FDFBF7;          /* Warm Cream / Soothing Off-White */
  --color-sand: #F5F0EB;            /* Soft Sand / Card Fill */
  --color-sand-deep: #ECE5DC;       /* Slightly deeper sand for nested cores */
  --color-charcoal: #1C1C1C;        /* Deep Charcoal for WCAG AAA text */
  --color-charcoal-muted: #5C564F;  /* Warm Slate for subtext */
  --color-charcoal-faint: #8E867C;  /* Muted metadata */
  --color-white: #FFFFFF;
  --color-border-subtle: rgba(28, 28, 28, 0.08);
  --color-border-warm: rgba(178, 61, 0, 0.22);
  --color-border-amber: rgba(244, 163, 64, 0.32);

  /* Typography */
  --font-main: 'Farmhand Serif', 'Farmhand', 'CMU Serif Roman', 'Playfair Display', Georgia, serif;
  --font-secondary: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-desc: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --font-serif: var(--font-main);
  --font-sans: var(--font-secondary);
  --font-nav: 'Farmhand Regular', 'Farmhand', 'Farmhand Serif', Georgia, serif;
  --font-weight-nav: 500;

  /* Elevation & Shadows (Tinted to background, no harsh black) */
  --shadow-sm: 0 2px 8px rgba(120, 80, 50, 0.04);
  --shadow-md: 0 10px 30px -10px rgba(100, 60, 30, 0.08), 0 4px 12px -2px rgba(100, 60, 30, 0.03);
  --shadow-lg: 0 20px 40px -15px rgba(100, 60, 30, 0.12), 0 8px 16px -4px rgba(100, 60, 30, 0.04);
  --shadow-inner-highlight: inset 0 1px 1px rgba(255, 255, 255, 0.8), inset 0 -1px 1px rgba(200, 90, 39, 0.05);

  /* Radii (Soft Squircle Scales) */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 9999px;

  /* Spacing Scale (Fluid Clamped) */
  --space-xs: clamp(0.35rem, 0.3vw + 0.3rem, 0.5rem);
  --space-sm: clamp(0.65rem, 0.6vw + 0.5rem, 1rem);
  --space-md: clamp(1rem, 1vw + 0.75rem, 1.5rem);
  --space-lg: clamp(1.5rem, 2vw + 1rem, 2.5rem);
  --space-xl: clamp(2.25rem, 3.5vw + 1.5rem, 4rem);
  --space-2xl: clamp(3rem, 5vw + 2rem, 6rem);
  --space-3xl: clamp(4rem, 6.5vw + 2.5rem, 8rem);

  /* Layout Container */
  --max-width: 1280px;
  --max-width-narrow: 860px;
  --nav-height: 74px;

  /* Fluid Transitions */
  --ease-spring: cubic-bezier(0.16, 1, 0.3, 1);
  --transition-smooth: all 0.35s var(--ease-spring);
  --transition-fast: all 0.2s ease;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  background-color: var(--color-canvas);
  color: var(--color-charcoal);
  line-height: 1.65;
  overflow-x: hidden;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  color: inherit;
}

a {
  color: inherit;
  text-decoration: none;
  transition: var(--transition-fast);
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* Skip link for accessibility */
.skip-link {
  position: absolute;
  top: -100px;
  left: 1.5rem;
  background: var(--color-sun-core);
  color: var(--color-white);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-full);
  z-index: 9999;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus {
  top: 1.5rem;
}

/* ==========================================================================
   TYPOGRAPHY
   ========================================================================== */
h1, h2, h3, h4, .font-serif {
  font-family: var(--font-serif);
  color: var(--color-charcoal);
  line-height: 1.15;
  font-weight: 600;
  letter-spacing: -0.02em;
}

h1 {
  font-size: clamp(1.85rem, 3.5vw + 0.95rem, 3.85rem);
  line-height: 1.12;
  letter-spacing: -0.025em;
}

h2 {
  font-size: clamp(1.45rem, 2.25vw + 0.95rem, 2.75rem);
  line-height: 1.2;
}

h3 {
  font-size: clamp(1.15rem, 1.2vw + 0.9rem, 1.85rem);
  line-height: 1.3;
}

h4 {
  font-size: clamp(1rem, 0.5vw + 0.88rem, 1.25rem);
  line-height: 1.4;
}

p,
.description,
.desc,
[class*="-desc"],
.service-desc,
.feature-desc,
.card-desc,
.faq-answer,
.step-desc,
.bio-p,
.story-text,
.quote-text {
  font-family: var(--font-desc);
  font-size: clamp(0.96rem, 0.4vw + 0.84rem, 1.05rem);
  color: var(--color-charcoal-muted);
  line-height: 1.72;
}

.text-lead {
  font-family: var(--font-desc);
  font-size: clamp(1.05rem, 0.8vw + 0.75rem, 1.35rem);
  line-height: 1.6;
  color: var(--color-charcoal);
}

.text-sm {
  font-family: var(--font-desc);
  font-size: 0.9rem;
  line-height: 1.5;
}

.text-xs {
  font-family: var(--font-desc);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
}

.text-accent {
  color: var(--color-sun-core); /* #B23D00 */
}

.text-amber {
  color: var(--color-sun-arch);
}

/* Accessible Link & Phone Contrast Rules (AA Compliant >= 5:1) */
a.link-accent,
p a:not(.btn):not(.nav-link),
.prose a:not(.btn) {
  color: var(--color-link);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
}

a.link-accent:hover,
p a:not(.btn):not(.nav-link):hover,
.prose a:not(.btn):hover {
  color: var(--color-link-hover);
}

/* Explicit Phone Links & Telephony Overrides */
a[href^="tel:"],
.contact-phone-number,
.footer-tel-link {
  color: var(--color-phone) !important;
  font-weight: 700;
  letter-spacing: 0.01em;
}

a[href^="tel:"]:hover,
.contact-phone-number:hover,
.footer-tel-link:hover {
  color: var(--color-phone-hover) !important;
  text-decoration: underline;
}

/* Pale Badges text contrast guarantee */
.photo-floating-badge .text-accent,
.photo-floating-badge strong,
.badge-pale-accent,
.license-pill,
.pt-seal-title {
  color: var(--color-phone);
}

/* Eyebrow badge */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.95rem;
  background: var(--color-sun-arch-soft);
  color: var(--color-sun-core);
  border: 1px solid var(--color-border-amber);
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

.eyebrow-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-sun-core);
  display: inline-block;
}

/* ==========================================================================
   LAYOUT CONTAINERS & GRIDS
   ========================================================================== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(1rem, 3.5vw, 2.5rem);
  padding-right: clamp(1rem, 3.5vw, 2.5rem);
}

.container-narrow {
  max-width: var(--max-width-narrow);
}

.section {
  padding-top: clamp(2.75rem, 5vw, 6rem);
  padding-bottom: clamp(2.75rem, 5vw, 6rem);
  position: relative;
}

.section-hero {
  padding-top: clamp(2.25rem, 4vw, 4rem);
  padding-bottom: clamp(2.75rem, 5vw, 5rem);
}

.section-cream {
  background-color: var(--color-canvas);
}

.section-sand {
  background-color: var(--color-sand);
}

/* Flex & Grid Utilities */
.grid {
  display: grid;
  gap: clamp(1.5rem, 3vw, 2.25rem);
}

.grid-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.grid-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.grid-bento-hero {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: clamp(2rem, 4vw, 3.5rem);
  align-items: center;
}

/* ==========================================================================
   DOUBLE-BEZEL TACTILE CARD ARCHITECTURE (Doppelrand)
   Machined, tactile elegance: Outer Sand Shell + Inner Highlight Core
   ========================================================================== */
.bezel-card {
  background: var(--color-sand);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: 0.5rem;
  box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth);
  position: relative;
}

.bezel-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-border-warm);
}

.bezel-core {
  background: var(--color-white);
  border-radius: calc(var(--radius-xl) - 0.35rem);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  box-shadow: var(--shadow-inner-highlight);
  height: 100%;
  display: flex;
  flex-direction: column;
}

/* Soft Sand flat card */
.sand-card {
  background: var(--color-sand);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 3vw, 2.25rem);
  transition: var(--transition-smooth);
}

.sand-card:hover {
  border-color: var(--color-border-warm);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* ==========================================================================
   BUTTON ARCHITECTURE (Nested Island & Pill Patterns)
   ========================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.45rem, 1.2vw + 0.2rem, 0.75rem);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: clamp(0.85rem, 0.8vw + 0.55rem, 0.98rem);
  padding: clamp(0.65rem, 1vw + 0.35rem, 0.85rem) clamp(1rem, 2vw + 0.4rem, 1.65rem);
  border-radius: var(--radius-full);
  border: 1.5px solid transparent;
  transition: var(--transition-smooth);
  text-decoration: none;
  line-height: 1.2;
  box-sizing: border-box;
  max-width: 100%;
  text-align: center;
  min-height: clamp(44px, 2vw + 38px, 48px);
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--color-main);
  color: #1C1C1C;
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(244, 163, 64, 0.32);
}

.btn-primary:hover {
  background: var(--color-main-hover);
  box-shadow: 0 6px 18px rgba(244, 163, 64, 0.42);
  color: #1C1C1C;
  transform: translateY(-1px);
}

.btn-secondary {
  background: var(--color-sand);
  color: var(--color-secondary);
  border: 1.5px solid var(--color-secondary);
  font-weight: 600;
}

.btn-secondary:hover {
  background: var(--color-white);
  border-color: var(--color-secondary-hover);
  color: var(--color-secondary-hover);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  color: var(--color-charcoal);
  border: 1.5px solid rgba(28, 28, 28, 0.2);
}

.btn-outline:hover {
  border-color: var(--color-secondary);
  color: var(--color-secondary);
  background: rgba(198, 93, 30, 0.05);
}

/* Button-in-button nested trailing icon */
.btn-icon-circle {
  width: clamp(22px, 2vw + 14px, 26px);
  height: clamp(22px, 2vw + 14px, 26px);
  border-radius: 50%;
  background: rgba(28, 28, 28, 0.12);
  color: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(0.72rem, 1vw + 0.45rem, 0.85rem);
  line-height: 1;
  transition: transform 0.25s var(--ease-spring);
  flex-shrink: 0;
}

.btn-primary:hover .btn-icon-circle {
  transform: translateX(3px) rotate(4deg);
  background: rgba(28, 28, 28, 0.2);
}

.btn-secondary .btn-icon-circle {
  background: rgba(198, 93, 30, 0.12);
  color: var(--color-secondary);
}

.btn-secondary:hover .btn-icon-circle {
  transform: translateX(3px);
  background: var(--color-secondary);
  color: var(--color-white);
}

/* ==========================================================================
   IMAGE FRAMES & PHOTO CONTAINERS
   ========================================================================== */
.framed-photo {
  position: relative;
  background: var(--color-sand);
  border: 1px solid var(--color-border-subtle);
  border-radius: var(--radius-xl);
  padding: 0.65rem;
  box-shadow: var(--shadow-md);
}

.framed-photo-inner {
  border-radius: calc(var(--radius-xl) - 0.45rem);
  overflow: hidden;
  position: relative;
  background: var(--color-sand-deep);
}

.framed-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-spring);
}

.framed-photo:hover img {
  transform: scale(1.02);
}

/* Warm badge on image */
.photo-floating-badge {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  background: rgba(253, 251, 247, 0.94);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border: 1px solid var(--color-border-amber);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  max-width: 85%;
}

/* ==========================================================================
   ANIMATIONS & REDUCED MOTION
   ========================================================================== */
.fade-up-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1), transform 0.55s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.fade-up-on-scroll.fade-in-entry {
  opacity: 1;
  transform: translateY(0);
}

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