/* =============================================================
   HADOF design-system upgrade layer
   Loaded last so it refines the existing theme without changing
   templates, content, or the nine-language / RTL structure.
   Respects prefers-reduced-motion and logical properties.
   ============================================================= */

:root {
  --ux-green: #154f3b;
  --ux-green-2: #173e32;
  --ux-green-3: #10291f;
  --ux-orange: #d65a32;
  --ux-orange-2: #bc4b29;
  --ux-ink: #172e27;
  --ux-muted: #657069;
  --ux-line: #dde3dc;
  --ux-paper: #f4f6f2;
  --ux-paper-2: #edf1eb;
  --ux-radius: 12px;
  --ux-radius-sm: 8px;
  --ux-shadow-sm: 0 1px 2px rgba(16, 41, 31, .05), 0 6px 18px rgba(16, 41, 31, .06);
  --ux-shadow-md: 0 14px 34px rgba(16, 41, 31, .10);
  --ux-shadow-lg: 0 28px 70px rgba(16, 41, 31, .16);
  --ux-ease: cubic-bezier(.22, .61, .36, 1);
  --ux-font: "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial,
    "PingFang SC", "Microsoft YaHei", "Noto Sans", sans-serif;
}

/* ---------- Base typography ---------- */
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ux-font);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
h1, h2, h3 { font-weight: 650; letter-spacing: -.03em; text-wrap: balance; }
::selection { background: #d65a32; color: #fff; }

/* Arabic and other scripts should not inherit Latin negative tracking. */
html[dir="rtl"] h1,
html[dir="rtl"] h2,
html[dir="rtl"] h3 { letter-spacing: 0; }

/* ---------- Sticky header elevation + glass ---------- */
.site-header {
  background: rgba(255, 255, 255, .86);
  -webkit-backdrop-filter: blur(14px) saturate(1.5);
  backdrop-filter: blur(14px) saturate(1.5);
  border-bottom-color: transparent;
  transition: box-shadow .28s var(--ux-ease), border-color .28s var(--ux-ease), background .28s var(--ux-ease);
}
.site-header.is-scrolled {
  border-bottom-color: var(--ux-line);
  box-shadow: var(--ux-shadow-sm);
  background: rgba(255, 255, 255, .94);
}

/* Top-level navigation labels */
.nav-dropdown {
  border-radius: 0 0 var(--ux-radius-sm) var(--ux-radius-sm);
  box-shadow: var(--ux-shadow-lg);
}
.nav-dropdown-link { border-radius: 6px; transition: background .16s var(--ux-ease), color .16s var(--ux-ease); }
.language-options { border-radius: var(--ux-radius-sm); box-shadow: var(--ux-shadow-md); }

/* ---------- Buttons ---------- */
.button,
.hd-button {
  border-radius: 999px;
  letter-spacing: .01em;
  box-shadow: 0 1px 2px rgba(16, 41, 31, .12);
  transition: transform .18s var(--ux-ease), box-shadow .18s var(--ux-ease),
    background .18s var(--ux-ease), border-color .18s var(--ux-ease), color .18s var(--ux-ease);
}
.button:hover,
.hd-button:hover {
  transform: translateY(-2px);
  box-shadow: var(--ux-shadow-md);
}
.button:active,
.hd-button:active { transform: translateY(0); box-shadow: 0 1px 2px rgba(16, 41, 31, .12); }

.hd-button-outline { box-shadow: none; }
.hd-button-outline:hover { box-shadow: var(--ux-shadow-md); }

.text-link,
.hd-inline {
  transition: color .18s var(--ux-ease), border-color .18s var(--ux-ease);
}

/* ---------- Section headings ---------- */
.hd-heading { max-width: 820px; }
.hd-heading .hd-kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}
.hd-heading .hd-kicker::before,
.hd-heading .hd-kicker::after {
  content: "";
  width: 24px;
  height: 1px;
  background: currentColor;
  opacity: .65;
}

.eyebrow { color: #9b5b42; }
.hd-kicker { color: #a44729; }

/* ---------- Cards: consistent corners, lift and image zoom ---------- */
.story-card,
.hd-product,
.hd-line,
.hd-guide,
.hd-material,
.hd-company-photo {
  transition: transform .26s var(--ux-ease), box-shadow .26s var(--ux-ease), border-color .26s var(--ux-ease);
  will-change: transform;
}

.hd-product {
  border: 1px solid var(--ux-line);
  border-radius: var(--ux-radius);
  padding: 12px;
  background: #fff;
}
.hd-product-photo {
  border-radius: var(--ux-radius-sm);
  background: var(--ux-paper);
  transition: background .26s var(--ux-ease);
}
.hd-product-photo img,
.hd-material-photo img,
.hd-line-photo img,
.hd-company-photo img,
.story-card .card-image img {
  transition: transform .55s var(--ux-ease);
}
.hd-product:hover .hd-product-photo img,
.hd-material:hover .hd-material-photo img,
.hd-line:hover .hd-line-photo img,
.hd-company-photo:hover img,
.story-card:hover .card-image img { transform: scale(1.045); }

.hd-product:hover,
.hd-material:hover,
.hd-line:hover,
.story-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ux-shadow-md);
  border-color: #c8d4c9;
}

.hd-line {
  border-radius: var(--ux-radius);
  border: 1px solid var(--ux-line);
}
.hd-line-photo { border-radius: var(--ux-radius-sm); }

.hd-material-photo {
  border-radius: var(--ux-radius);
  border: 1px solid var(--ux-line);
  background: #fff;
  transition: transform .26s var(--ux-ease), box-shadow .26s var(--ux-ease);
}
.hd-material:hover .hd-material-photo { transform: translateY(-3px); box-shadow: var(--ux-shadow-md); }

.hd-guide { border-top-width: 3px; }
.hd-guide:hover { transform: translateY(-4px); }

.hd-company-photo {
  border-radius: var(--ux-radius);
  border: 1px solid var(--ux-line);
  overflow: hidden;
  box-shadow: var(--ux-shadow-sm);
}

/* ---------- Interior cards ---------- */
.equipment-grid .story-card .card-image,
.guide-grid .story-card,
.solution-grid .story-card { border-radius: var(--ux-radius); }
.card-image { border-radius: var(--ux-radius); }
.equipment-grid .story-card .card-image img { border-radius: var(--ux-radius); }

/* ---------- Hero ---------- */
.hd-hero:after {
  background: linear-gradient(180deg, #071d18b8 0%, #0c261d75 45%, #0c261d20 78%, #0c261d7a 100%);
}
.hd-hero-content > * { animation: ux-rise .7s var(--ux-ease) both; }
.hd-hero-content > .hd-kicker { animation-delay: .04s; }
.hd-hero-content > h1 { animation-delay: .10s; }
.hd-hero-content > p { animation-delay: .18s; }
.hd-hero-content > .hd-button { animation-delay: .26s; }

.hd-hero-caption { background: rgba(10, 38, 31, .82); }
.hd-hero-caption .hd-wrap { letter-spacing: .02em; }

@keyframes ux-rise {
  from { opacity: 0; transform: translateY(18px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ---------- Scroll reveal (JS adds .reveal-ready) ---------- */
.reveal-ready { opacity: 0; transform: translateY(22px); transition: opacity .6s var(--ux-ease), transform .6s var(--ux-ease); transition-delay: var(--d, 0ms); }
.reveal-ready.is-visible { opacity: 1; transform: translateY(0); }

/* ---------- Support strip ---------- */
.hd-support a { transition: color .2s var(--ux-ease); }
.hd-support a:hover .hd-support-icon { color: var(--ux-orange); transform: translateY(-2px); }
.hd-support-icon { transition: transform .2s var(--ux-ease), color .2s var(--ux-ease); }

/* ---------- Contact band ---------- */
.hd-contact { background: linear-gradient(160deg, #173e32 0%, #10291f 100%); }
.hd-contact .hd-button { background: #d65a32; border-color: #d65a32; }
.hd-contact .hd-button:hover { background: #bc4b29; border-color: #bc4b29; }

/* ---------- Interior page polish ---------- */
.page-intro { position: relative; }
.page-intro h1 { letter-spacing: -.035em; }
.breadcrumbs { letter-spacing: .03em; }
.breadcrumbs a { color: var(--ux-green); }

.detail-hero figure { border-radius: var(--ux-radius); }
.detail-hero figure img { border-radius: var(--ux-radius-sm); }

/* Facts become stat cards. */
.facts { gap: 14px; }
.facts > div {
  background: var(--ux-paper);
  border: 1px solid var(--ux-line);
  border-top: 3px solid var(--ux-green);
  border-radius: var(--ux-radius-sm);
  padding: 18px 20px;
}
.facts dt { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--ux-muted); }
.facts dd { font-size: 17px; font-weight: 600; color: var(--ux-ink); }

.detail-process li { border-radius: var(--ux-radius-sm); border: 1px solid var(--ux-line); transition: transform .2s var(--ux-ease); }
.detail-process li:hover { transform: translateY(-2px); }

.notice { border-radius: 0 var(--ux-radius-sm) var(--ux-radius-sm) 0; }

.faq details { transition: background .2s var(--ux-ease); }
.faq details[open] { background: var(--ux-paper); }
.faq summary { font-weight: 600; }

/* Comparison table */
.comparison table { border-radius: var(--ux-radius-sm); overflow: hidden; }
.comparison tbody tr { transition: background .15s var(--ux-ease); }
.comparison tbody tr:hover { background: var(--ux-paper); }
.comparison tbody tr:nth-child(even) { background: #fafbf9; }
.comparison tbody tr:nth-child(even):hover { background: var(--ux-paper); }

/* Forms */
.project-form input:not([type="checkbox"]),
.project-form select,
.project-form textarea,
.hd-material-tools input {
  border-radius: var(--ux-radius-sm);
  transition: border-color .18s var(--ux-ease), box-shadow .18s var(--ux-ease);
}
.project-form input:not([type="checkbox"]):focus,
.project-form select:focus,
.project-form textarea:focus,
.hd-material-tools input:focus {
  border-color: var(--ux-green);
  box-shadow: 0 0 0 3px rgba(21, 79, 59, .14);
  outline: none;
}
.form-panel { border-radius: var(--ux-radius); }

/* ---------- Footer ---------- */
.site-footer a { transition: color .18s var(--ux-ease); }
.footer-main > div:not(:first-child) > a:hover,
.footer-bottom a:hover { color: #fff; }
.footer-brand { border-radius: 6px; }

/* ---------- Focus visibility (modern ring) ---------- */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible {
  outline: 3px solid var(--ux-orange);
  outline-offset: 3px;
  border-radius: 6px;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
  .reveal-ready { opacity: 1; transform: none; }
  .hd-hero-content > * { animation: none; }
}

/* ---------- Responsive refinements ---------- */
@media (min-width: 1101px) {
  .hd-hero { min-height: 680px; }
}
@media (max-width: 800px) {
  .facts { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  .facts { grid-template-columns: 1fr; }
  .hd-product { padding: 10px; }
}

/* ---------- Readability floor for micro-labels ---------- */
/* Several labels dropped to 8-9px on small screens; keep them readable
 * without changing the visual hierarchy. */
.eyebrow,
.hd-kicker,
.contact-label,
.card-copy > .eyebrow,
.closing .eyebrow,
.material-item span,
.detail-hero figcaption,
.footer-location,
.footer-bottom,
.market-card-top .eyebrow,
.freeze-market-callout small,
.hd-hero-content > .hd-kicker {
  font-size: 10px;
}
@media (max-width: 700px) {
  .eyebrow,
  .section-head .eyebrow,
  .hd-kicker,
  .contact-label,
  .card-copy > .eyebrow,
  .detail-hero figcaption,
  .material-item span,
  .footer-bottom,
  .market-card-top .eyebrow,
  .freeze-market-callout small,
  .hd-hero-content > .hd-kicker {
    font-size: 10px;
  }
}
