/* Omid Fard portfolio — quality refinement v1.
   Loaded AFTER existing styles. Deliberately preserves current visuals and imagery.
   No external fonts, CDNs, or dependencies. */

:root {
  --muted: #485b72;
  --line: #d8e3ef;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: 86px;
}

body {
  line-height: 1.68;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

p, li, small, .project-body, .contact-info, .section-head {
  overflow-wrap: anywhere;
}

:where(h1, h2, h3, h4) {
  text-wrap: balance;
  line-height: 1.25;
}

:where(p, li) { line-height: 1.72; }

/* Avoid text that is tiny on 100% browser zoom. */
.about-v8-copy p { font-size: clamp(14px, 1.12vw, 16px) !important; line-height: 1.83 !important; }
.about-v8-checks li { font-size: 13.5px !important; line-height: 1.65 !important; }
.about-v8-credential small { font-size: 12px !important; line-height: 1.58 !important; }
.about-v8-credential b { line-height: 1.4; }
.service p, .project-body p, .receipt-project-card .receipt-project-content p {
  font-size: 14px !important;
  line-height: 1.75 !important;
  color: #40546d !important;
}
.service h4, .project h4, .domain-copy b { line-height: 1.36; }
.domain-copy small { color: #455870; font-size: 13px; line-height: 1.66; }
.contact-info small, .form-note { color: #52647b; line-height: 1.7; }
.contact-success-content p { font-size: 15px; }
.section-kicker { font-size: 12px !important; letter-spacing: .1em; }

/* Keyboard access and input legibility. */
:where(a, button, input, textarea, select):focus-visible {
  outline: 3px solid #237dfa;
  outline-offset: 3px;
}
:where(input, textarea, select) { font-size: 16px; }
:where(button, .btn, .project a) { touch-action: manipulation; }

/* Images: keep intrinsic aspect ratio; no cropping of approved covers. */
img { max-width: 100%; }
.receipt-project-card .receipt-project-cover img { object-fit: contain !important; transform: none !important; }

/* Tablet refinements. */
@media (max-width: 900px) {
  .section, .card-wide, .contact-section { width: min(100% - 32px, 1220px); }
  .section-head { gap: 14px; }
}

@media (max-width: 760px) {
  html { scroll-padding-top: 72px; }
  .nav a { display: flex; min-height: 44px; align-items: center; }
  .site-header .brand { min-width: 0; }
  .hero { width: calc(100% - 24px); }
  .hero h1 { font-size: clamp(40px, 11vw, 54px); }
  .hero h2 { font-size: clamp(19px, 5.3vw, 23px); }
  .hero-copy { min-width: 0; }
  .section, .card-wide, .contact-section { width: calc(100% - 24px); }
  .section-head h3 { line-height: 1.3; }
  .about.about-v8 { padding: 20px !important; }
  .about-v8-title { font-size: clamp(23px, 6vw, 27px) !important; }
  .contact-form { min-width: 0; }
}

@media (max-width: 430px) {
  .hero { padding-inline: 12px; }
  .hero-copy { padding-inline: 0; }
  .hero h1 { font-size: clamp(36px, 11vw, 46px); }
  .hero-actions { flex-wrap: wrap; }
  .hero-actions .btn { max-width: 100%; }
  .hero-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .float-card { max-width: min(58vw, 215px); }
  .about-v8-credential small { font-size: 12.5px !important; }
}

/* Respect visitors' accessibility preferences. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
  }
}
