/* ==========================================================================
   Petroman Sanaat — Premium Industrial Minimalism design system
   Dark-first, RTL, no framework. Theme via <html data-theme="dark|light">.
   ========================================================================== */

/* ---------- 1. Fonts (self-hosted Vazirmatn) ---------- */
@font-face { font-family: "Vazirmatn"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/vazirmatn/Vazirmatn-Regular.woff2") format("woff2"); }
@font-face { font-family: "Vazirmatn"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/vazirmatn/Vazirmatn-Medium.woff2") format("woff2"); }
@font-face { font-family: "Vazirmatn"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/vazirmatn/Vazirmatn-SemiBold.woff2") format("woff2"); }
@font-face { font-family: "Vazirmatn"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/vazirmatn/Vazirmatn-Bold.woff2") format("woff2"); }
@font-face { font-family: "Vazirmatn"; font-weight: 800; font-style: normal; font-display: swap; src: url("../fonts/vazirmatn/Vazirmatn-ExtraBold.woff2") format("woff2"); }
@font-face { font-family: "Vazirmatn"; font-weight: 900; font-style: normal; font-display: swap; src: url("../fonts/vazirmatn/Vazirmatn-Black.woff2") format("woff2"); }

/* ---------- 2. Design tokens ---------- */
:root {
  color-scheme: dark;

  /* surfaces */
  --bg: #050f17;
  --bg-2: #081a26;
  --surface: #0b202f;
  --surface-2: #102a3c;
  --surface-3: #16374c;
  --navy: #0b2a3d;
  --line: rgba(140, 200, 214, 0.14);
  --line-strong: rgba(140, 200, 214, 0.3);

  /* text */
  --text: #ecf5f8;
  --text-2: #b6cad3;
  --text-3: #86a0ac;

  /* accent (teal / cyan family) */
  --accent: #34c0c9;
  --accent-2: #1f8a93;
  --accent-strong: #5fd6dd;
  --accent-text: #62d4db;
  --accent-contrast: #031820;
  --accent-soft: rgba(52, 192, 201, 0.12);
  --accent-glow: rgba(52, 192, 201, 0.35);
  --focus: #7fe3e9;

  /* semantic */
  --ok: #43d6a0;
  --ok-soft: rgba(67, 214, 160, 0.13);
  --warn: #e8b64c;
  --warn-soft: rgba(232, 182, 76, 0.14);
  --danger: #ff8080;
  --danger-soft: rgba(255, 128, 128, 0.13);
  --info-soft: rgba(52, 192, 201, 0.12);

  /* chrome */
  --header-bg: rgba(5, 15, 23, 0.74);
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 14px 34px -14px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 34px 70px -24px rgba(0, 0, 0, 0.75);
  --input-bg: #071824;
  --pipe-edge: #2a5a73;
  --pipe-fill: #0e2c3e;
  --pipe-accent-edge: #34c0c9;
  --pipe-accent-fill: #0f4a56;
  --hero-image-opacity: 0.34;
  --grid-line: rgba(140, 200, 214, 0.06);
  --scroll-thumb: #1c4258;
  --scroll-track: #050f17;

  /* shape + rhythm */
  --r-xs: 6px;
  --r-sm: 10px;
  --r-md: 14px;
  --r-lg: 20px;
  --container: 1200px;
  --gutter: clamp(1.1rem, 4vw, 2.25rem);
  --section-y: clamp(4rem, 9vw, 7.5rem);
  --header-h: 72px;
  --ease: cubic-bezier(0.22, 0.8, 0.24, 1);
  --t-fast: 160ms;
  --t-med: 320ms;
  --font: "Vazirmatn", "Segoe UI", Tahoma, system-ui, -apple-system, sans-serif;
}

:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f1f6f8;
  --bg-2: #e7eff3;
  --surface: #ffffff;
  --surface-2: #f6f9fb;
  --surface-3: #e5eef2;
  --navy: #0b2a3d;
  --line: rgba(11, 42, 61, 0.12);
  --line-strong: rgba(11, 42, 61, 0.26);
  --text: #07202f;
  --text-2: #334f5d;
  --text-3: #587180;
  --accent: #17747d;
  --accent-2: #1f8a93;
  --accent-strong: #0f5f67;
  --accent-text: #0f6a73;
  --accent-contrast: #ffffff;
  --accent-soft: rgba(23, 116, 125, 0.09);
  --accent-glow: rgba(23, 116, 125, 0.28);
  --focus: #0b6b73;
  --ok: #0d7a55;
  --ok-soft: rgba(13, 122, 85, 0.1);
  --warn: #8a5a00;
  --warn-soft: rgba(197, 130, 0, 0.12);
  --danger: #b4232d;
  --danger-soft: rgba(180, 35, 45, 0.09);
  --header-bg: rgba(241, 246, 248, 0.82);
  --shadow-sm: 0 1px 2px rgba(11, 42, 61, 0.08);
  --shadow-md: 0 14px 30px -16px rgba(11, 42, 61, 0.28);
  --shadow-lg: 0 34px 60px -26px rgba(11, 42, 61, 0.34);
  --input-bg: #ffffff;
  --pipe-edge: #8fb1c1;
  --pipe-fill: #dbe8ee;
  --pipe-accent-edge: #17747d;
  --pipe-accent-fill: #bfe0e3;
  --hero-image-opacity: 0.2;
  --grid-line: rgba(11, 42, 61, 0.06);
  --scroll-thumb: #a9c2cf;
  --scroll-track: #e7eff3;
}

/* No-JS fallback: follow the OS preference when data-theme was never set */
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    color-scheme: light;
    --bg: #f1f6f8;
    --bg-2: #e7eff3;
    --surface: #ffffff;
    --surface-2: #f6f9fb;
    --surface-3: #e5eef2;
    --line: rgba(11, 42, 61, 0.12);
    --line-strong: rgba(11, 42, 61, 0.26);
    --text: #07202f;
    --text-2: #334f5d;
    --text-3: #587180;
    --accent: #17747d;
    --accent-2: #1f8a93;
    --accent-strong: #0f5f67;
    --accent-text: #0f6a73;
    --accent-contrast: #ffffff;
    --accent-soft: rgba(23, 116, 125, 0.09);
    --accent-glow: rgba(23, 116, 125, 0.28);
    --focus: #0b6b73;
    --ok: #0d7a55;
    --ok-soft: rgba(13, 122, 85, 0.1);
    --warn: #8a5a00;
    --warn-soft: rgba(197, 130, 0, 0.12);
    --danger: #b4232d;
    --danger-soft: rgba(180, 35, 45, 0.09);
    --header-bg: rgba(241, 246, 248, 0.82);
    --shadow-md: 0 14px 30px -16px rgba(11, 42, 61, 0.28);
    --shadow-lg: 0 34px 60px -26px rgba(11, 42, 61, 0.34);
    --input-bg: #ffffff;
    --pipe-edge: #8fb1c1;
    --pipe-fill: #dbe8ee;
    --pipe-accent-edge: #17747d;
    --pipe-accent-fill: #bfe0e3;
    --hero-image-opacity: 0.2;
    --grid-line: rgba(11, 42, 61, 0.06);
    --scroll-thumb: #a9c2cf;
    --scroll-track: #e7eff3;
  }
}

/* ---------- 3. Base ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  scrollbar-color: var(--scroll-thumb) var(--scroll-track);
  scrollbar-width: thin;
  background: var(--bg);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.9;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body.nav-open { overflow: hidden; }
main { flex: 1 0 auto; display: block; }
main:focus { outline: none; }

h1, h2, h3, h4 { margin: 0 0 0.6em; line-height: 1.4; font-weight: 800; letter-spacing: 0; color: var(--text); }
h1 { font-size: clamp(2rem, 5vw, 3.1rem); font-weight: 900; }
h2 { font-size: clamp(1.55rem, 3.4vw, 2.25rem); }
h3 { font-size: 1.2rem; font-weight: 700; }
h4 { font-size: 1rem; font-weight: 700; }
p { margin: 0 0 1.1em; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--accent-text); text-decoration: none; transition: color var(--t-fast) var(--ease); }
a:hover { color: var(--accent-strong); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2rem 0; }
code, pre, kbd { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.92em; }
::selection { background: var(--accent); color: var(--accent-contrast); }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: var(--r-xs);
}

.skip-link {
  position: absolute;
  inset-inline-start: 1rem;
  top: -4rem;
  z-index: 200;
  padding: 0.7rem 1.1rem;
  border-radius: var(--r-sm);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 700;
  transition: top var(--t-fast) var(--ease);
}
.skip-link:focus { top: 1rem; color: var(--accent-contrast); }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ltr { direction: ltr; unicode-bidi: isolate; display: inline-block; }
.nowrap { white-space: nowrap; }
.icon { width: 1.25em; height: 1.25em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon-fill { fill: currentColor; stroke: none; }

/* Scrollbar */
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--scroll-track); }
::-webkit-scrollbar-thumb {
  background: var(--scroll-thumb);
  border-radius: 999px;
  border: 3px solid var(--scroll-track);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-2); }

/* ---------- 4. Layout primitives ---------- */
.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 880px; }
.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--alt { background: var(--bg-2); border-block: 1px solid var(--line); }
.section-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem 2rem; margin-bottom: clamp(1.75rem, 4vw, 3rem); }
.section-head h2 { margin: 0; max-width: 28ch; }
.section-head p { margin: 0.6rem 0 0; color: var(--text-2); max-width: 56ch; }

.eyebrow {
  display: inline-flex; align-items: center; gap: 0.7rem;
  margin: 0 0 1rem;
  font-size: 0.86rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--accent-text);
}
.eyebrow::before { content: ""; width: 2rem; height: 2px; background: linear-gradient(90deg, transparent, var(--accent)); border-radius: 2px; }
.lead { font-size: clamp(1.02rem, 1.6vw, 1.2rem); color: var(--text-2); line-height: 2; max-width: 62ch; }
.muted { color: var(--text-3); }
.stack > * + * { margin-top: 1rem; }

/* ---------- 5. Buttons ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  min-height: 48px; padding: 0 1.5rem;
  font: inherit; font-weight: 700; font-size: 0.98rem; line-height: 1;
  border: 1px solid transparent; border-radius: var(--r-sm);
  cursor: pointer; text-align: center; white-space: nowrap;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease),
    border-color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease), box-shadow var(--t-med) var(--ease);
}
.btn .icon { transition: transform var(--t-med) var(--ease); }
.btn:hover .icon-arrow { transform: translateX(-4px); }
.btn:active { transform: translateY(1px); }
.btn[disabled], .btn.is-busy { opacity: 0.65; pointer-events: none; }

.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-strong); color: var(--accent-contrast); box-shadow: 0 10px 28px -10px var(--accent-glow); transform: translateY(-1px); }
:root[data-theme="light"] .btn-primary:hover { background: var(--accent-strong); }

.btn-outline { background: transparent; color: var(--text); border-color: var(--line-strong); }
.btn-outline:hover { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); }

.btn-quiet { background: var(--accent-soft); color: var(--accent-text); }
.btn-quiet:hover { background: var(--surface-3); color: var(--text); }

.btn-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.btn-danger:hover { background: var(--danger); color: #fff; }

.btn-sm { min-height: 38px; padding: 0 1rem; font-size: 0.88rem; border-radius: var(--r-xs); }
.btn-lg { min-height: 56px; padding: 0 2rem; font-size: 1.05rem; }
.btn-block { width: 100%; }

.link-arrow { display: inline-flex; align-items: center; gap: 0.5rem; font-weight: 700; }
.link-arrow .icon { transition: transform var(--t-med) var(--ease); }
.link-arrow:hover .icon { transform: translateX(-5px); }

/* ---------- 6. Site header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--header-bg);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  border-bottom: 1px solid var(--line);
  transition: box-shadow var(--t-med) var(--ease), background var(--t-med) var(--ease);
}
.site-header.is-scrolled { box-shadow: var(--shadow-md); }
.header-inner {
  min-height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: nowrap;
}

.brand { display: inline-flex; align-items: center; gap: 0.85rem; color: var(--text); margin-inline-end: auto; min-width: 0; }
.brand:hover { color: var(--text); }
.brand-mark {
  width: 44px; height: 48px; flex: none; padding: 4px;
  display: grid; place-items: center;
  background: #f4f9fb; border-radius: 11px;
  box-shadow: inset 0 0 0 1px rgba(11, 42, 61, 0.1), 0 6px 16px -8px rgba(0, 0, 0, 0.6);
  transition: transform var(--t-med) var(--ease);
}
.brand:hover .brand-mark { transform: rotate(-4deg) scale(1.04); }
.brand-mark img { width: 100%; height: 100%; object-fit: contain; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brand-fa { font-size: 1.2rem; font-weight: 900; }
.brand-en { font-size: 0.66rem; font-weight: 600; letter-spacing: 0.32em; color: var(--accent-text); direction: ltr; text-align: start; }

.site-nav { display: none; }
.nav-list { display: flex; align-items: center; gap: 0.15rem; margin: 0; padding: 0; list-style: none; }
.nav-link {
  position: relative; display: inline-flex; align-items: center;
  padding: 0.5rem 0.8rem; font-size: 0.95rem; font-weight: 500; color: var(--text-2);
  border-radius: var(--r-xs);
}
.nav-link::after {
  content: ""; position: absolute; inset-inline: 0.8rem; bottom: 0.15rem; height: 2px;
  background: var(--accent); border-radius: 2px; transform: scaleX(0); transform-origin: right;
  transition: transform var(--t-med) var(--ease);
}
.nav-link:hover { color: var(--text); }
.nav-link:hover::after, .nav-link[aria-current="page"]::after { transform: scaleX(1); }
.nav-link[aria-current="page"] { color: var(--text); font-weight: 700; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex: none;
  margin-inline-start: 0.25rem;
  z-index: 120;
}
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  background: transparent; color: var(--text-2); cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--r-sm);
  transition: color var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.icon-btn:hover { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); }
.theme-toggle .i-sun { display: none; }
:root[data-theme="light"] .theme-toggle .i-sun { display: block; }
:root[data-theme="light"] .theme-toggle .i-moon { display: none; }
html:not(.js) .theme-toggle, html:not(.js) .nav-toggle { display: none; }
.header-cta { display: none; }
.nav-toggle .i-close { display: none; }
.nav-toggle[aria-expanded="true"] .i-menu { display: none; }
.nav-toggle[aria-expanded="true"] .i-close { display: block; }

.nav-scrim {
  display: none;
  position: fixed;
  top: var(--header-h);
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  background: rgba(2, 8, 14, 0.62);
  border: 0;
  padding: 0;
  cursor: pointer;
}
.nav-panel-tools { display: none; }
.theme-toggle--menu {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  width: 100%;
  min-height: 52px;
  padding: 0.75rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font: inherit;
  text-align: start;
}
.theme-toggle--menu .theme-toggle-icons {
  display: inline-grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-text);
  flex: none;
}
.theme-toggle--menu .theme-toggle-label { font-weight: 700; font-size: 0.98rem; }
.theme-toggle--desktop { display: none; }

body.nav-open { overflow: hidden; touch-action: none; }

/* Mobile drawer */
@media (max-width: 1023.98px) {
  .theme-toggle--desktop { display: none !important; }

  .nav-scrim {
    display: block;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--t-med) var(--ease), visibility 0s linear var(--t-med);
  }
  body.nav-open .nav-scrim {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .site-nav {
    position: fixed;
    top: var(--header-h);
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 100;
    width: 100%;
    height: calc(100dvh - var(--header-h));
    max-height: calc(100vh - var(--header-h));
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 0.5rem var(--gutter) calc(1.25rem + env(safe-area-inset-bottom, 0px));
    background: var(--bg-2);
    border-top: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    opacity: 0;
    visibility: hidden;
    transform: translate3d(0, -10px, 0);
    pointer-events: none;
    transition: opacity var(--t-med) var(--ease), transform var(--t-med) var(--ease), visibility 0s linear var(--t-med);
  }
  .site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .site-nav .nav-list {
    display: flex !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 0 !important;
    width: 100%;
    margin: 0;
    padding: 0;
  }
  .site-nav .nav-list > li { width: 100%; display: block; }
  .site-nav .nav-link {
    display: flex;
    width: 100%;
    padding: 0.95rem 0.35rem;
    font-size: 1.05rem;
    line-height: 1.5;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    min-height: 52px;
  }
  .site-nav .nav-link::after { display: none; }
  .site-nav .nav-link[aria-current="page"] { color: var(--accent-text); }

  .nav-panel-tools {
    display: grid !important;
    gap: 0.85rem;
    width: 100%;
    margin-top: auto;
    padding-top: 1.25rem;
  }
  .site-nav .nav-cta-mobile {
    width: 100%;
    justify-content: center;
  }

  html:not(.js) .site-nav {
    position: static;
    height: auto;
    max-height: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    padding: 0 0 1rem;
    background: none;
    border: 0;
    box-shadow: none;
  }
  html:not(.js) .nav-list { flex-direction: row !important; flex-wrap: wrap; }
  html:not(.js) .nav-link { border: 0; padding: 0.4rem 0.6rem; font-size: 0.95rem; min-height: 0; width: auto; }
  html:not(.js) .nav-scrim, html:not(.js) .nav-panel-tools { display: none !important; }
}

@media (min-width: 1024px) {
  .site-nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: static;
    height: auto;
    max-height: none;
    width: auto;
    background: transparent;
    border: 0;
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
    overflow: visible;
    padding: 0;
  }
  .nav-toggle,
  .nav-scrim,
  .nav-panel-tools,
  .theme-toggle--menu { display: none !important; }
  .theme-toggle--desktop { display: inline-grid; }
  .header-cta { display: inline-flex; }
}

/* ---------- 7. Hero (home) ---------- */
.hero {
  position: relative; isolation: isolate; overflow: hidden;
  /* Keep hero compact so the spec-strip sits inside the first viewport */
  padding-block: clamp(1.25rem, 3.5vw, 2.75rem) clamp(1.25rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--line);
  min-height: unset;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -3;
  background: var(--bg) url("../images/categories/products-hero.jpg") center / cover no-repeat;
  opacity: 1;
}
.hero-shade {
  position: absolute; inset: 0; z-index: -2;
  background:
    linear-gradient(to left, var(--bg) 0%, color-mix(in srgb, var(--bg) 88%, transparent) 38%, color-mix(in srgb, var(--bg) calc((1 - var(--hero-image-opacity)) * 100%), transparent) 100%),
    linear-gradient(to top, var(--bg) 0%, transparent 38%);
}
.hero-grid {
  position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 56px 56px;
  -webkit-mask-image: radial-gradient(ellipse 80% 80% at 70% 40%, #000 0%, transparent 75%);
  mask-image: radial-gradient(ellipse 80% 80% at 70% 40%, #000 0%, transparent 75%);
}
.hero-inner { display: grid; gap: 2.5rem; align-items: center; }
.hero-since {
  display: inline-flex; align-items: center; gap: 0.75rem; margin-bottom: 1.4rem;
  padding: 0.35rem 1rem 0.35rem 0.7rem;
  font-size: 0.9rem; font-weight: 600; color: var(--accent-text);
  border: 1px solid var(--line-strong); border-radius: 999px; background: color-mix(in srgb, var(--bg) 60%, transparent);
}
.hero-since::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 0 14px var(--accent-glow); }
.hero-title { margin: 0; line-height: 1.12; }
.hero-brand-fa {
  display: block; font-size: clamp(2.6rem, 8vw, 5.5rem); font-weight: 900; letter-spacing: -0.01em; line-height: 1.15;
  background: linear-gradient(100deg, var(--text) 30%, var(--accent-strong) 120%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero-brand-en {
  display: block; margin-top: 0.35rem; direction: ltr; text-align: start;
  font-size: clamp(0.85rem, 2vw, 1.2rem); font-weight: 600; letter-spacing: 0.45em; color: var(--accent-text);
}
.hero-lead { margin-top: 1.1rem; max-width: 52ch; font-size: clamp(0.98rem, 1.5vw, 1.12rem); color: var(--text-2); line-height: 1.85; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.35rem; }
.hero-art { display: none; position: relative; }
.hero-art svg { width: 100%; height: auto; max-height: 340px; overflow: visible; }
.pipe-edge { fill: none; stroke: var(--pipe-edge); stroke-width: 64; stroke-linecap: butt; }
.pipe-fill { fill: none; stroke: var(--pipe-fill); stroke-width: 58; stroke-linecap: butt; }
.pipe-edge--accent { stroke: var(--pipe-accent-edge); }
.pipe-fill--accent { stroke: var(--pipe-accent-fill); }
.pipe-flow { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 6 18; opacity: 0.85; animation: flow 3.2s linear infinite; }
.flange { fill: var(--surface-3); stroke: var(--line-strong); stroke-width: 1.5; }
.flange--accent { fill: var(--accent-2); stroke: var(--accent); }
.bolt { fill: var(--bg); stroke: var(--line-strong); stroke-width: 1; }
.art-label { font-family: var(--font); font-size: 11px; fill: var(--text-3); letter-spacing: 0.1em; }
.art-dim { stroke: var(--line-strong); stroke-width: 1; stroke-dasharray: 3 4; fill: none; }
@keyframes flow { to { stroke-dashoffset: -96; } }

@media (min-width: 960px) {
  .hero-inner { grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 3rem; }
  .hero-art { display: block; }
}

/* Spec strip beneath hero */
.spec-strip { border-bottom: 1px solid var(--line); background: var(--bg-2); }
.spec-strip ul { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.spec-strip li { padding: 1.25rem 1rem; border-inline-start: 1px solid var(--line); display: flex; flex-direction: column; gap: 0.1rem; }
.spec-strip li:nth-child(odd) { border-inline-start: 0; }
.spec-strip li:nth-child(n + 3) { border-top: 1px solid var(--line); }
.spec-k { font-size: 0.78rem; font-weight: 600; color: var(--text-3); letter-spacing: 0.04em; }
.spec-v { font-size: 1.02rem; font-weight: 700; color: var(--text); line-height: 1.6; }
@media (min-width: 880px) {
  .spec-strip ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .spec-strip li { border-top: 0 !important; padding: 1.15rem 1.25rem; }
  .spec-strip li:nth-child(odd) { border-inline-start: 1px solid var(--line); }
  .spec-strip li:first-child { border-inline-start: 0; }
}

/* First viewport composition: hero + spec strip under sticky header */
@media (min-height: 700px) and (min-width: 960px) {
  .hero {
    min-height: calc(100svh - var(--header-h) - 7.5rem);
    display: flex;
    align-items: center;
    padding-block: 1.5rem 1.25rem;
  }
  .hero .container { width: 100%; }
}

/* ---------- 8. Intro split ---------- */
.split { display: grid; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
@media (min-width: 900px) { .split { grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); } .split--even { grid-template-columns: 1fr 1fr; } }
.prose p { color: var(--text-2); line-height: 2.1; }
.prose p:first-of-type { color: var(--text); font-size: 1.1rem; }
.deflist { border-top: 1px solid var(--line); }
.deflist > div { display: grid; grid-template-columns: minmax(7rem, 0.4fr) 1fr; gap: 1rem; padding: 1rem 0; border-bottom: 1px solid var(--line); }
.deflist dt { font-weight: 600; color: var(--text-3); font-size: 0.92rem; }
.deflist dd { margin: 0; font-weight: 600; color: var(--text); overflow-wrap: anywhere; }

/* ---------- 9. Category index list ---------- */
.index-list { display: grid; border-top: 1px solid var(--line); }
@media (min-width: 720px) { .index-list { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 3rem; } }
@media (min-width: 1100px) { .index-list { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.index-item {
  position: relative;
  display: grid;
  grid-template-columns: 1.7rem minmax(0, 1fr) 1.25rem;
  align-items: start;
  column-gap: 0.85rem;
  min-height: 5.75rem;
  padding: 1.05rem 0.85rem;
  color: var(--text);
  border-bottom: 1px solid var(--line);
  transition: color var(--t-fast) var(--ease), background var(--t-med) var(--ease);
}
.index-item::before {
  content: ""; position: absolute; inset-block: -1px; inset-inline-start: 0; width: 2px; background: var(--accent);
  transform: scaleY(0); transition: transform var(--t-med) var(--ease);
}
.index-num {
  font-size: 0.82rem; font-weight: 600; color: var(--text-3);
  font-variant-numeric: tabular-nums; padding-top: 0.2rem;
}
.index-name {
  min-width: 0;
  font-weight: 700;
  line-height: 1.55;
}
.index-item .icon {
  width: 1.25rem;
  height: 1.25rem;
  margin-top: 0.25rem;
  color: var(--text-3);
  opacity: 0.55;
  transition: color var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease), transform var(--t-med) var(--ease);
}
.index-item:hover {
  color: var(--accent-text);
  background: linear-gradient(to left, transparent, var(--accent-soft));
}
.index-item:hover::before { transform: scaleY(1); }
.index-item:hover .icon { opacity: 1; color: var(--accent-text); transform: translateX(-3px); }
.index-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  min-height: 2.6em;
  font-size: 0.86rem;
  font-weight: 400;
  color: var(--text-3);
  margin-top: 0.2rem;
  line-height: 1.5;
}

/* ---------- 10. Project tiles ---------- */
.project-grid { display: grid; gap: 1rem; grid-template-columns: 1fr; }
@media (min-width: 560px) { .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 960px) { .project-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 960px) {
  .project-grid--feature { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .project-grid--feature > :first-child { grid-column: span 2; grid-row: span 2; }
  .project-grid--feature > :first-child .project-media { aspect-ratio: auto; height: 100%; min-height: 420px; }
}
.project-tile {
  position: relative; display: block; overflow: hidden; color: #fff;
  border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface);
  transition: border-color var(--t-med) var(--ease), transform var(--t-med) var(--ease), box-shadow var(--t-med) var(--ease);
}
.project-tile:hover { color: #fff; border-color: var(--accent); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.project-media { position: relative; aspect-ratio: 4 / 3; overflow: hidden; background: var(--surface-2); }
.project-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 700ms var(--ease), filter var(--t-med) var(--ease); filter: saturate(0.85) contrast(1.02); }
.project-tile:hover .project-media img { transform: scale(1.06); filter: saturate(1.05); }
.project-media::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(3, 14, 22, 0.92) 0%, rgba(3, 14, 22, 0.35) 48%, rgba(3, 14, 22, 0) 78%);
}
.project-media--empty {
  display: grid; place-items: center;
  background:
    linear-gradient(var(--grid-line) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px) 0 0 / 28px 28px,
    linear-gradient(160deg, var(--surface-2), var(--surface));
}
.project-media--empty svg { width: 46px; height: 46px; color: var(--text-3); opacity: 0.6; }
.project-body { position: absolute; inset-inline: 0; bottom: 0; z-index: 1; padding: 1.1rem 1.25rem 1.2rem; }
.project-industry { display: inline-block; margin-bottom: 0.3rem; font-size: 0.78rem; font-weight: 700; color: #7fe3e9; letter-spacing: 0.03em; }
.project-name { margin: 0; font-size: 1.08rem; font-weight: 800; line-height: 1.55; color: #fff; }
.project-media--empty ~ .project-body .project-name { color: var(--text); }
.project-media--empty ~ .project-body .project-industry { color: var(--accent-text); }
.project-tile:has(.project-media--empty) { color: var(--text); }
.project-tile:has(.project-media--empty):hover { color: var(--text); }
.project-tile:has(.project-media--empty) .project-media::after { display: none; }
.project-tile:has(.project-media--empty) .project-body { background: linear-gradient(to top, var(--surface) 55%, transparent); padding-top: 2rem; }

/* ---------- 11. CTA band ---------- */
.cta-band {
  position: relative; overflow: hidden; isolation: isolate;
  border-block: 1px solid var(--line);
  background: linear-gradient(120deg, var(--navy) 0%, #0a3a4b 60%, #0c4e5b 130%);
  color: #f2fafc;
}
:root[data-theme="light"] .cta-band { background: linear-gradient(120deg, #0b2a3d 0%, #0f4a58 100%); }
.cta-band::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: 0.5;
  background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 48px 48px;
  -webkit-mask-image: linear-gradient(to left, #000, transparent 75%); mask-image: linear-gradient(to left, #000, transparent 75%);
}
.cta-inner { display: grid; gap: 1.75rem; align-items: center; padding-block: clamp(3rem, 7vw, 5rem); }
@media (min-width: 860px) { .cta-inner { grid-template-columns: 1fr auto; } }
.cta-band h2 { color: #fff; margin-bottom: 0.5rem; }
.cta-band p { color: #c3dce3; margin: 0; max-width: 56ch; }
.cta-actions { display: flex; flex-wrap: wrap; gap: 0.8rem; }
.cta-band .btn-primary { background: #5fd6dd; color: #03232b; }
.cta-band .btn-primary:hover { background: #8fe6eb; color: #03232b; }
.cta-band .btn-outline { color: #fff; border-color: rgba(255, 255, 255, 0.38); }
.cta-band .btn-outline:hover { background: rgba(255, 255, 255, 0.1); border-color: #fff; color: #fff; }

/* ---------- 12. Page header (inner pages) ---------- */
.page-hero {
  position: relative; isolation: isolate; overflow: hidden;
  padding-block: clamp(2.75rem, 7vw, 5rem) clamp(2.25rem, 5vw, 3.5rem);
  border-bottom: 1px solid var(--line); background: var(--bg-2);
}
.page-hero::before {
  content: ""; position: absolute; inset: 0; z-index: -2;
  background: var(--hero-img, none) center / cover no-repeat; opacity: calc(var(--hero-image-opacity) * 0.8);
  filter: grayscale(0.4);
}
.page-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(to left, var(--bg-2) 8%, color-mix(in srgb, var(--bg-2) 60%, transparent) 70%, transparent 100%),
    linear-gradient(to top, var(--bg-2), transparent 55%);
}
.page-hero h1 { margin-bottom: 0.5rem; }
.page-hero .lead { margin: 0.75rem 0 0; }
.breadcrumbs { margin-bottom: 1.25rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.6rem; font-size: 0.88rem; color: var(--text-3); }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 0.6rem; }
.breadcrumbs li + li::before { content: "/"; opacity: 0.5; }
.breadcrumbs a { color: var(--text-2); }
.breadcrumbs a:hover { color: var(--accent-text); }
.breadcrumbs [aria-current] { color: var(--text); font-weight: 600; }

/* ---------- 13. Search, chips, tiles, spec list ---------- */
.search-form { display: flex; gap: 0.6rem; max-width: 640px; margin-top: 1.75rem; }
.search-form .input { flex: 1; min-width: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 2rem; }
.chip {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0 1rem;
  font-size: 0.9rem; font-weight: 600; color: var(--text-2);
  border: 1px solid var(--line-strong); border-radius: 999px;
  transition: all var(--t-fast) var(--ease);
}
.chip:hover { color: var(--accent-text); border-color: var(--accent); background: var(--accent-soft); }
.chip.is-active, .chip[aria-current="true"] { color: var(--accent-contrast); background: var(--accent); border-color: var(--accent); }

.tile-grid { display: grid; gap: 0.85rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); }
.tile {
  position: relative; display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1.15rem 1.25rem; color: var(--text); font-weight: 700;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color var(--t-med) var(--ease), transform var(--t-med) var(--ease), background var(--t-med) var(--ease);
}
.tile .icon { color: var(--text-3); transition: transform var(--t-med) var(--ease), color var(--t-fast) var(--ease); }
.tile:hover { color: var(--accent-text); border-color: var(--accent); transform: translateY(-2px); background: var(--surface-2); }
.tile:hover .icon { color: var(--accent-text); transform: translateX(-4px); }
.tile small { display: block; font-weight: 400; color: var(--text-3); font-size: 0.82rem; }

.spec-list { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.spec-row { display: grid; gap: 0.25rem 1.5rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); transition: background var(--t-fast) var(--ease); }
.spec-row:last-child { border-bottom: 0; }
.spec-row:hover { background: var(--surface-2); }
@media (min-width: 720px) { .spec-row { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1.4fr); align-items: center; } }
.spec-row--head { background: var(--surface-2); font-size: 0.8rem; font-weight: 700; color: var(--text-3); letter-spacing: 0.04em; display: none; }
.spec-row--head:hover { background: var(--surface-2); }
@media (min-width: 720px) { .spec-row--head { display: grid; } }
.spec-name { font-weight: 700; }
.spec-name a { color: var(--text); }
.spec-name a:hover { color: var(--accent-text); }
.spec-brand { display: inline-flex; align-items: center; width: fit-content; padding: 0.1rem 0.7rem; font-size: 0.85rem; font-weight: 600; color: var(--accent-text); background: var(--accent-soft); border-radius: 999px; }
.spec-note { color: var(--text-3); font-size: 0.92rem; }
.spec-cat { color: var(--text-3); font-size: 0.85rem; }

.empty-state { padding: clamp(2.5rem, 6vw, 4rem) 1.5rem; text-align: center; border: 1px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--text-2); background: var(--surface); }
.empty-state h3 { margin-bottom: 0.4rem; }
.empty-state p { margin: 0 auto; max-width: 46ch; color: var(--text-3); }

/* ---------- 14. Forms ---------- */
.form-panel {
  padding: clamp(1.4rem, 4vw, 2.4rem);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-md);
}
.form-grid { display: grid; gap: 1.1rem 1.25rem; }
@media (min-width: 640px) { .form-grid--2 { grid-template-columns: 1fr 1fr; } .form-grid .span-2 { grid-column: 1 / -1; } }
.field { display: flex; flex-direction: column; gap: 0.45rem; min-width: 0; }
.field > label, .field-label { font-size: 0.92rem; font-weight: 700; color: var(--text); }
.field .req { color: var(--accent-text); margin-inline-start: 0.2rem; }
.field .hint { font-size: 0.82rem; color: var(--text-3); }
.input, .select, .textarea {
  width: 100%; min-height: 50px; padding: 0.65rem 1rem;
  font: inherit; font-size: 1rem; color: var(--text); line-height: 1.6;
  background: var(--input-bg); border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  transition: border-color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.textarea { min-height: 150px; resize: vertical; line-height: 1.9; }
.input::placeholder, .textarea::placeholder { color: var(--text-3); opacity: 0.8; }
.input:hover, .select:hover, .textarea:hover { border-color: color-mix(in srgb, var(--accent) 60%, var(--line-strong)); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), 0 0 0 1px var(--accent); }
.input-ltr { direction: ltr; text-align: right; }
.select { appearance: none; -webkit-appearance: none; padding-inline-end: 2.6rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2386a0ac' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: left 1rem center; }
.select option { background: var(--surface); color: var(--text); }
.input.input-validation-error, .textarea.input-validation-error, .select.input-validation-error { border-color: var(--danger); }
.field-error, .field-validation-error { display: block; font-size: 0.85rem; font-weight: 600; color: var(--danger); min-height: 0; }
.field-validation-valid { display: none; }
.validation-summary-errors ul { padding-inline-start: 1.1rem; list-style: disc; }
.check { display: inline-flex; align-items: center; gap: 0.7rem; cursor: pointer; font-weight: 600; min-height: 44px; }
.check input { width: 1.2rem; height: 1.2rem; accent-color: var(--accent); }
.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; margin-top: 1.5rem; }
.form-note { font-size: 0.85rem; color: var(--text-3); margin: 1rem 0 0; }

/* Honeypot: invisible to people and assistive tech, present for bots */
.hp { position: absolute !important; inset-inline-start: -9999px; top: auto; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }

.alert {
  display: flex; gap: 0.8rem; align-items: flex-start; padding: 1rem 1.2rem; margin-bottom: 1.5rem;
  border: 1px solid transparent; border-radius: var(--r-md); font-weight: 600; line-height: 1.8;
}
.alert .icon { margin-top: 0.3rem; }
.alert-success { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.alert-danger { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 30%, transparent); }
.alert-warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 30%, transparent); }
.alert-info { background: var(--info-soft); color: var(--accent-text); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }

/* ---------- 15. Contact / aside blocks ---------- */
.contact-layout { display: grid; gap: clamp(2rem, 5vw, 3.5rem); align-items: start; }
@media (min-width: 940px) { .contact-layout { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); } }
.contact-list { border-top: 1px solid var(--line); }
.contact-item { display: flex; gap: 1rem; align-items: flex-start; padding: 1.15rem 0; border-bottom: 1px solid var(--line); }
.contact-item .icon-wrap { display: grid; place-items: center; width: 44px; height: 44px; flex: none; color: var(--accent-text); background: var(--accent-soft); border-radius: var(--r-sm); }
.contact-item dt, .contact-item .k { font-size: 0.82rem; color: var(--text-3); font-weight: 600; margin: 0; }
.contact-item dd, .contact-item .v { margin: 0; font-weight: 700; line-height: 1.8; }
.contact-item a { color: var(--text); }
.contact-item a:hover { color: var(--accent-text); }
.social-row { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.25rem; }

.steps { counter-reset: step; display: grid; gap: 0; border-top: 1px solid var(--line); }
.steps li { counter-increment: step; display: grid; grid-template-columns: auto 1fr; gap: 1rem; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.steps li::before { content: counter(step, persian); display: grid; place-items: center; width: 2.2rem; height: 2.2rem; font-weight: 800; font-size: 0.95rem; color: var(--accent-text); border: 1px solid var(--line-strong); border-radius: 50%; }
.steps strong { display: block; color: var(--text); }
.steps span { color: var(--text-3); font-size: 0.92rem; }

/* Values (about) */
.values { display: grid; gap: 0; border-top: 1px solid var(--line); }
@media (min-width: 800px) { .values { grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 0; } .values > div { border-top: 1px solid var(--line); border-inline-start: 1px solid var(--line); padding: 2rem 1.75rem !important; } .values > div:first-child { border-inline-start: 0; padding-inline-start: 0 !important; } }
.values > div { padding: 1.5rem 0; border-bottom: 1px solid var(--line); }
@media (min-width: 800px) { .values > div { border-bottom: 1px solid var(--line); } }
.value-num { display: block; font-size: 0.85rem; font-weight: 700; color: var(--accent-text); letter-spacing: 0.05em; margin-bottom: 0.6rem; }
.values h3 { margin-bottom: 0.4rem; }
.values p { margin: 0; color: var(--text-2); }

.focus-list { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.focus-list li { padding: 0.45rem 1.05rem; font-weight: 600; font-size: 0.95rem; border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); }

.milestone { display: flex; align-items: baseline; gap: 1.25rem; padding-block: 1.5rem; border-block: 1px solid var(--line); }
.milestone strong { font-size: clamp(3rem, 9vw, 5.5rem); font-weight: 900; line-height: 1; color: var(--accent-text); letter-spacing: -0.02em; }
.milestone span { color: var(--text-2); font-weight: 600; }

/* Confirmation / tracking */
.code-block { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; padding: 0.85rem 1rem; background: var(--input-bg); border: 1px solid var(--line-strong); border-radius: var(--r-sm); }
.code-block code { direction: ltr; unicode-bidi: isolate; overflow-wrap: anywhere; font-weight: 600; color: var(--accent-text); font-size: 1rem; text-align: start; flex: 1; }
.confirm-grid { display: grid; gap: 1.5rem; }
.confirm-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; color: var(--ok); background: var(--ok-soft); border: 1px solid color-mix(in srgb, var(--ok) 35%, transparent); margin-bottom: 1.25rem; }
.confirm-icon .icon { width: 30px; height: 30px; stroke-width: 2.2; }

.status-badge { display: inline-flex; align-items: center; gap: 0.5rem; padding: 0.35rem 1rem; font-weight: 700; font-size: 0.92rem; border-radius: 999px; background: var(--accent-soft); color: var(--accent-text); }
.status-badge::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.timeline { display: grid; gap: 0; margin: 0; padding: 0; }
.timeline li { position: relative; padding-inline-start: 2rem; padding-bottom: 1.4rem; }
.timeline li::before { content: ""; position: absolute; inset-inline-start: 0; top: 0.65rem; width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.timeline li::after { content: ""; position: absolute; inset-inline-start: 4px; top: 1.4rem; bottom: -0.2rem; width: 2px; background: var(--line-strong); }
.timeline li:last-child::after { display: none; }
.timeline .k { display: block; font-size: 0.82rem; color: var(--text-3); font-weight: 600; }
.timeline .v { font-weight: 700; }

/* Error / 404 */
.error-hero { min-height: 60vh; display: grid; place-items: center; text-align: center; padding-block: 5rem; }
.error-code { display: block; font-size: clamp(5rem, 22vw, 11rem); font-weight: 900; line-height: 1; letter-spacing: -0.03em; background: linear-gradient(180deg, var(--accent-strong), transparent 130%); -webkit-background-clip: text; background-clip: text; color: transparent; direction: ltr; }
.error-hero .lead { margin-inline: auto; }
.error-hero .hero-actions { justify-content: center; }

/* ---------- 16. Footer ---------- */
.site-footer { margin-top: auto; background: var(--bg-2); border-top: 1px solid var(--line); }
.footer-grid { display: grid; gap: 2.5rem; padding-block: clamp(2.75rem, 6vw, 4.25rem) 2.25rem; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 0.8fr 0.8fr 1.2fr; gap: 2rem; } }
.footer-brand p { color: var(--text-3); max-width: 38ch; margin-top: 1rem; font-size: 0.95rem; }
.footer-col h2 { font-size: 0.82rem; font-weight: 700; color: var(--text-3); letter-spacing: 0.06em; margin-bottom: 1rem; }
.footer-col li + li { margin-top: 0.15rem; }
.footer-col a { display: inline-block; padding: 0.2rem 0; color: var(--text-2); font-weight: 500; }
.footer-col a:hover { color: var(--accent-text); }
.footer-col address { font-style: normal; color: var(--text-2); line-height: 1.9; font-size: 0.95rem; }
.footer-bottom { border-top: 1px solid var(--line); }
.footer-bottom .container { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 1.5rem; padding-block: 1.25rem; font-size: 0.85rem; color: var(--text-3); }
.footer-bottom p { margin: 0; }
.footer-credit a { color: var(--text-2); text-decoration: underline; text-underline-offset: 0.15em; }
.footer-credit a:hover { color: var(--accent-text); }

/* ---------- 17. Scroll reveal ---------- */
html.js .reveal { opacity: 0; transform: translateY(22px); transition: opacity 700ms var(--ease), transform 700ms var(--ease); transition-delay: var(--d, 0ms); will-change: opacity, transform; }
html.js .reveal.is-visible { opacity: 1; transform: none; will-change: auto; }
html.js .reveal-fade { opacity: 0; transition: opacity 900ms var(--ease); transition-delay: var(--d, 0ms); }
html.js .reveal-fade.is-visible { opacity: 1; }

@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero-since, .hero-title, .hero-lead, .hero-actions { animation: rise 800ms var(--ease) both; }
.hero-title { animation-delay: 80ms; }
.hero-lead { animation-delay: 180ms; }
.hero-actions { animation-delay: 280ms; }
.hero-art { animation: rise 1100ms var(--ease) 200ms both; }

/* ---------- 18. Admin ---------- */
.admin-body { background: var(--bg); }
.admin-shell { display: grid; min-height: 100vh; width: 100%; }
@media (min-width: 960px) { .admin-shell { grid-template-columns: 264px minmax(0, 1fr); } }
.admin-side {
  position: fixed; inset-block: 0; inset-inline-start: 0; z-index: 120; width: min(300px, 86vw);
  display: flex; flex-direction: column; padding: 1.25rem 1rem;
  background: var(--bg-2); border-inline-end: 1px solid var(--line); overflow-y: auto;
  transform: translateX(100%); visibility: hidden;
  transition: transform var(--t-med) var(--ease), visibility 0s linear var(--t-med);
}
.admin-side.is-open { transform: none; visibility: visible; transition-delay: 0s; box-shadow: var(--shadow-lg); }
@media (min-width: 960px) {
  .admin-side { position: sticky; top: 0; height: 100vh; transform: none; visibility: visible; width: auto; box-shadow: none; }
}
.admin-scrim { position: fixed; inset: 0; z-index: 110; background: rgba(2, 8, 12, 0.6); opacity: 0; visibility: hidden; transition: opacity var(--t-med) var(--ease), visibility 0s linear var(--t-med); }
body.nav-open .admin-scrim { opacity: 1; visibility: visible; transition-delay: 0s; }
@media (min-width: 960px) { .admin-scrim { display: none; } }
.admin-brand { display: flex; align-items: center; gap: 0.75rem; padding: 0.25rem 0.5rem 1.25rem; margin-bottom: 0.75rem; border-bottom: 1px solid var(--line); color: var(--text); }
.admin-brand:hover { color: var(--text); }
.admin-brand .brand-mark { width: 38px; height: 42px; }
.admin-brand small { display: block; font-size: 0.75rem; color: var(--text-3); font-weight: 500; }
.admin-nav { display: grid; gap: 0.15rem; }
.admin-nav-title { margin: 1rem 0.75rem 0.4rem; font-size: 0.72rem; font-weight: 700; color: var(--text-3); letter-spacing: 0.08em; }
.admin-link { display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.75rem; font-weight: 600; font-size: 0.95rem; color: var(--text-2); border-radius: var(--r-sm); border: 1px solid transparent; transition: all var(--t-fast) var(--ease); }
.admin-link .icon { width: 1.15em; height: 1.15em; color: var(--text-3); }
.admin-link:hover { color: var(--text); background: var(--surface); }
.admin-link[aria-current="page"] { color: var(--accent-text); background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 25%, transparent); }
.admin-link[aria-current="page"] .icon { color: var(--accent-text); }
.admin-side-foot { margin-top: auto; padding-top: 1.25rem; display: grid; gap: 0.6rem; }
.admin-user { font-size: 0.85rem; color: var(--text-3); padding-inline: 0.5rem; }
.admin-user strong { color: var(--text); display: block; }

.admin-main { min-width: 0; display: flex; flex-direction: column; }
.admin-topbar { position: sticky; top: 0; z-index: 80; display: flex; align-items: center; gap: 0.75rem; min-height: 64px; padding: 0.5rem var(--gutter); background: var(--header-bg); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.admin-topbar h1 { margin: 0; font-size: 1.15rem; font-weight: 800; margin-inline-end: auto; }
@media (min-width: 960px) { .admin-topbar .nav-toggle { display: none; } }
.admin-content { flex: 1; padding: clamp(1.25rem, 3vw, 2.25rem) var(--gutter) 4rem; width: 100%; max-width: 1280px; }
.admin-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.75rem 1rem; margin-bottom: 1.25rem; }
.admin-toolbar form { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }
.admin-toolbar .select { width: auto; min-width: 200px; min-height: 42px; }
.page-title { font-size: clamp(1.4rem, 3vw, 1.9rem); margin-bottom: 0.25rem; }
.page-sub { color: var(--text-3); margin-bottom: 1.5rem; }

.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.panel-pad { padding: clamp(1.1rem, 3vw, 1.75rem); }
.panel + .panel { margin-top: 1.25rem; }
.panel h2 { font-size: 1.1rem; margin-bottom: 1rem; }

.stat-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); }
.stat {
  position: relative; display: flex; flex-direction: column; gap: 0.25rem; padding: 1.25rem 1.4rem; overflow: hidden;
  color: var(--text); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  transition: border-color var(--t-med) var(--ease), transform var(--t-med) var(--ease);
}
.stat:hover { color: var(--text); border-color: var(--accent); transform: translateY(-2px); }
.stat-label { font-size: 0.88rem; font-weight: 600; color: var(--text-3); }
.stat-value { font-size: 2.4rem; font-weight: 900; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat-hint { font-size: 0.8rem; color: var(--text-3); }
.stat--attention { border-color: color-mix(in srgb, var(--warn) 45%, var(--line)); }
.stat--attention .stat-value { color: var(--warn); }
.stat--danger { border-color: color-mix(in srgb, var(--danger) 45%, var(--line)); }
.stat--danger .stat-value { color: var(--danger); }

.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.table { width: 100%; border-collapse: collapse; min-width: 640px; font-size: 0.94rem; }
.table th { padding: 0.85rem 1rem; text-align: start; font-size: 0.78rem; font-weight: 700; color: var(--text-3); letter-spacing: 0.04em; background: var(--surface-2); border-bottom: 1px solid var(--line); white-space: nowrap; }
.table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--line); vertical-align: middle; line-height: 1.7; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr { transition: background var(--t-fast) var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table .col-actions { white-space: nowrap; text-align: end; }
.table .col-actions form { display: inline; }
.table .cell-main { font-weight: 700; color: var(--text); }
.table .cell-main a { color: var(--text); }
.table .cell-main a:hover { color: var(--accent-text); }
.table .cell-sub { display: block; font-size: 0.82rem; color: var(--text-3); font-weight: 400; }
.table tr.is-unread td:first-child { box-shadow: inset -3px 0 0 var(--accent); }
.table tr.is-unread .cell-main { font-weight: 800; }
.row-actions { display: inline-flex; gap: 0.4rem; justify-content: flex-end; flex-wrap: wrap; }

.badge { display: inline-flex; align-items: center; gap: 0.4rem; padding: 0.15rem 0.75rem; font-size: 0.8rem; font-weight: 700; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge-ok { background: var(--ok-soft); color: var(--ok); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-danger { background: var(--danger-soft); color: var(--danger); }
.badge-info { background: var(--accent-soft); color: var(--accent-text); }
.badge-muted { background: var(--surface-3); color: var(--text-3); }

.detail-grid { display: grid; gap: 1.25rem; align-items: start; }
@media (min-width: 1024px) { .detail-grid { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); } }
.dl { margin: 0; }
.dl > div { display: grid; grid-template-columns: minmax(6.5rem, 0.35fr) 1fr; gap: 1rem; padding: 0.8rem 0; border-bottom: 1px solid var(--line); }
.dl > div:last-child { border-bottom: 0; }
.dl dt { color: var(--text-3); font-size: 0.88rem; font-weight: 600; }
.dl dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.message-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 2; padding: 1.1rem 1.25rem; background: var(--input-bg); border: 1px solid var(--line); border-radius: var(--r-sm); font-weight: 400; }
.message-body--mono { direction: ltr; text-align: left; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 0.88rem; line-height: 1.7; }
.inline-form { display: inline; }
.thumb { width: 64px; height: 46px; object-fit: cover; border-radius: var(--r-xs); border: 1px solid var(--line); background: var(--surface-2); }
.thumb--empty { display: inline-grid; place-items: center; color: var(--text-3); }
.admin-empty { padding: 3rem 1rem; text-align: center; color: var(--text-3); }

.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 2rem var(--gutter); position: relative; isolation: isolate; overflow: hidden; }
.login-wrap::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px); background-size: 52px 52px; -webkit-mask-image: radial-gradient(ellipse at center, #000 0%, transparent 70%); mask-image: radial-gradient(ellipse at center, #000 0%, transparent 70%); }
.login-card { width: 100%; max-width: 420px; padding: clamp(1.6rem, 5vw, 2.5rem); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.login-card .brand { margin-bottom: 1.75rem; }
.login-card h1 { font-size: 1.5rem; margin-bottom: 0.25rem; }
.login-corner { position: fixed; top: 1rem; inset-inline-end: 1rem; }

/* ---------- 19. Prose / legal helpers ---------- */
.rich p { color: var(--text-2); line-height: 2.1; }
.detail-hero { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--surface-2); box-shadow: var(--shadow-lg); }
.detail-hero img { width: 100%; max-height: 560px; object-fit: cover; }

/* ---------- 20. Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; transition-delay: 0ms !important; }
  html.js .reveal, html.js .reveal-fade { opacity: 1; transform: none; }
  .pipe-flow { animation: none; }
}

/* ---------- 21. Print ---------- */
@media print {
  .site-header, .site-footer, .cta-band, .hero-art, .theme-toggle, .admin-side, .admin-topbar { display: none !important; }
  body { background: #fff; color: #000; }
}

/* --- Local run utilities (cards, forms, admin) --- */
.card-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.surface-card, .surface-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.25rem 1.35rem;
  color: inherit;
  text-decoration: none;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
a.surface-card:hover { border-color: var(--accent); transform: translateY(-2px); background: var(--surface-2); }
.surface-card h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.surface-card p, .muted { color: var(--text-3); margin: 0; }
.project-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.project-card {
  display: block; overflow: hidden; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface); text-decoration: none; color: inherit;
  transition: transform .2s ease, border-color .2s ease;
}
.project-card:hover { transform: translateY(-3px); border-color: var(--accent); }
.project-card img { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }
.project-card-body { padding: 1rem 1.1rem 1.2rem; }
.project-placeholder {
  aspect-ratio: 16/10; display: grid; place-items: center;
  background: linear-gradient(135deg, var(--surface-2), var(--surface-3));
  color: var(--text-3); font-size: .9rem;
}
.project-placeholder.large { min-height: 280px; aspect-ratio: auto; border-radius: 14px; }
.detail-image { width: 100%; border-radius: 16px; border: 1px solid var(--line); }
.search-bar { display: flex; gap: .75rem; flex-wrap: wrap; margin-top: 1.25rem; }
.search-bar input { flex: 1; min-width: 220px; }
.filter-row { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1.25rem; }
.leaf-list { display: flex; flex-wrap: wrap; gap: .55rem; padding: 0; list-style: none; }
.leaf-list li {
  padding: .45rem .8rem; border-radius: 999px; border: 1px solid var(--line);
  background: var(--surface-2); font-size: .92rem;
}
.section-actions { margin-top: 1.75rem; }
.section-title { margin: 0 0 1rem; }
.contact-layout { display: grid; gap: 1.5rem; }
@media (min-width: 900px) { .contact-layout { grid-template-columns: .9fr 1.1fr; } }
.narrow { max-width: 720px; }
.hp { position: absolute; left: -9999px; height: 0; overflow: hidden; }
.tracking-token code { word-break: break-all; font-size: 1rem; color: var(--accent-text); }
.text-link { color: var(--accent-text); text-decoration: none; font-weight: 700; }
.text-link:hover { text-decoration: underline; }
.breadcrumbs { display: flex; flex-wrap: wrap; gap: .35rem; color: var(--text-3); margin-bottom: .75rem; font-size: .92rem; }
.breadcrumbs a { color: var(--accent-text); text-decoration: none; }
.footer-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .55rem; color: var(--text-2); }
.footer-list a { color: var(--accent-text); text-decoration: none; }
.footer-brand { margin: 0 0 .5rem; }
.footer-tagline { color: var(--text-3); max-width: 36ch; }
.footer-social { display: flex; gap: .9rem; margin-top: 1rem; }
.footer-social a { color: var(--accent-text); text-decoration: none; font-weight: 600; }
.footer-bottom { border-top: 1px solid var(--line); padding: 1rem 0 1.5rem; color: var(--text-3); font-size: .9rem; }
.stat { font-size: 2rem; font-weight: 800; color: var(--accent-text); margin: .35rem 0 0; }
.admin-body { margin: 0; }
.admin-shell { display: grid; min-height: 100vh; }
@media (min-width: 960px) { .admin-shell { grid-template-columns: 240px 1fr; } }
.admin-side {
  background: var(--bg-2); border-inline-end: 1px solid var(--line);
  padding: 1.25rem; display: flex; flex-direction: column; gap: 1rem;
}
.admin-side nav { display: grid; gap: .35rem; }
.admin-side nav a {
  color: var(--text-2); text-decoration: none; padding: .55rem .7rem; border-radius: 8px;
}
.admin-side nav a:hover { background: var(--accent-soft); color: var(--text); }
.admin-main { padding: 1.5rem; }
.check-row { display: flex; align-items: center; gap: .5rem; color: var(--text-2); }
input, textarea, select {
  width: 100%; border-radius: 10px; border: 1px solid var(--line); background: var(--bg-2);
  color: var(--text); padding: .75rem .9rem; font: inherit;
}
textarea { resize: vertical; min-height: 110px; }
input:focus, textarea:focus, select:focus { outline: 2px solid var(--focus); outline-offset: 1px; }
@media (min-width: 992px) {
  .hero-inner { grid-template-columns: 1.2fr .8fr; }
  .hero-art { display: block; }
  .hero-art img { width: min(100%, 420px); margin-inline: auto; filter: drop-shadow(0 20px 50px rgba(0,0,0,.35)); }
}
