/* Atelier Souss Soudage: one stylesheet for both pages (Darija RTL + French LTR).
   Logical properties (inset-inline-*, margin-inline) flip automatically with dir. */

:root {
  --ink-950: #0E0F11; --ink-900: #17191C; --ink-800: #1F2226; --ink-700: #2A2E33;
  --ink-400: #A9A39A; --ink-300: #C8C2B8; --ink-50: #F4F1EC;
  --o-900: #2B1306; --o-800: #5A2A0E; --o-500: #FF6B1A; --o-400: #FF8A3D; --o-300: #FFB37A;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
svg[hidden] { display: none; }
body {
  margin: 0; background: var(--ink-950); color: var(--ink-50);
  font-family: 'Tajawal', 'Segoe UI', Tahoma, sans-serif; font-size: 17px; line-height: 1.7;
  overflow-x: hidden;
}
h1, h2, h3 { font-family: 'Cairo', sans-serif; margin: 0; }
h2 { font-weight: 900; font-size: clamp(28px, 4vw, 40px); line-height: 1.3; }
p { margin: 0; }
img { display: block; max-width: 100%; }
a { color: var(--o-400); }
a:hover { color: var(--o-300); }
:focus-visible { outline: 3px solid var(--o-300); outline-offset: 3px; }
section[id] { scroll-margin-top: 80px; }

.wrap { max-width: 1240px; margin-inline: auto; padding-inline: 24px; }
.i { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
html[dir="ltr"] .flip { transform: scaleX(-1); }
.accent { color: var(--o-500); }
.muted { color: var(--ink-400); }
.eyebrow { color: var(--o-400); font-weight: 700; font-size: 15px; }
.stack { display: flex; flex-direction: column; gap: 44px; }
.intro { display: flex; flex-direction: column; gap: 8px; max-width: 660px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(255px, 100%), 1fr)); gap: 18px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 18px; border-radius: 12px; text-decoration: none; font-weight: 800; text-align: center;
  transition: translate .2s, background-color .2s, color .2s, border-color .2s;
}
.btn:hover { translate: 0 -2px; }
.btn-o { background: var(--o-500); color: var(--ink-950); }
.btn-o:hover { background: var(--o-400); color: var(--ink-950); }
.btn-g { border: 1px solid var(--ink-700); color: var(--ink-50); font-weight: 700; }
.btn-g:hover { background: var(--o-500); border-color: var(--o-500); color: var(--ink-950); }
.btn-lg { min-height: 56px; padding: 0 28px; border-radius: 14px; font-size: 18px; }
.btn-sq { min-width: 44px; padding: 0; font-size: 15px; }
.btn-line { border: 2px solid var(--o-500); color: var(--ink-50); border-radius: 14px; min-height: 54px; align-self: flex-start; }
.btn-line .i { color: var(--o-400); }
.btn-dark { position: relative; background: var(--ink-950); color: var(--ink-50); min-height: 58px; padding: 0 30px; border-radius: 14px; font-size: 18px; }
.btn-dark:hover { color: var(--ink-50); }
.btn-dark .i { color: var(--o-400); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(14, 15, 17, .82); backdrop-filter: blur(12px); border-bottom: 1px solid var(--ink-700);
}
.site-header .wrap { padding-block: 12px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink-50); }
.brand:hover { color: var(--ink-50); }
.brand-mark { border-radius: 12px; }
.brand-name { display: block; font-family: 'Cairo', sans-serif; font-weight: 900; font-size: 22px; line-height: 1.2; }
.brand-sub { display: block; font-size: 13px; color: var(--ink-400); line-height: 1.2; }
.nav { display: flex; flex-wrap: wrap; gap: 4px 28px; font-weight: 500; }
.nav a { color: var(--ink-50); text-decoration: none; padding-block: 10px; }
.nav a:hover { color: var(--o-400); }
.header-actions { display: flex; align-items: center; gap: 10px; }

/* ---------- hero ---------- */
.hero { padding-block: 72px 64px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); gap: 56px; align-items: center; }
.hero-text { display: flex; flex-direction: column; gap: 24px; }
.badge {
  align-self: flex-start; display: flex; align-items: center; gap: 8px;
  background: var(--o-900); color: var(--o-300); border: 1px solid var(--o-800);
  font-weight: 700; font-size: 15px; padding: 6px 14px; border-radius: 999px;
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--o-500); }
.hero h1 { font-weight: 900; font-size: clamp(34px, 5vw, 64px); line-height: 1.25; }
.lead { font-size: 19px; color: var(--ink-400); max-width: 520px; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 8px; border-top: 1px solid var(--ink-700); padding-top: 22px; }
.stats b { display: block; font-family: 'Cairo', sans-serif; font-weight: 900; font-size: 28px; color: var(--o-400); }
.stats span { font-size: 14px; color: var(--ink-400); }

.hero-media { position: relative; padding: 18px; }
.hero-frame { position: absolute; inset-block: 0 40px; inset-inline: 40px 0; border: 2px solid var(--o-500); border-radius: 26px; }
.hero-img { position: relative; border-radius: 22px; overflow: hidden; }
.hero-img img { width: 100%; height: auto; }
.float-card {
  position: absolute; bottom: -6px; inset-inline-start: -6px;
  background: var(--ink-900); border: 1px solid var(--ink-700); border-radius: 16px; padding: 14px 18px;
  display: flex; align-items: center; gap: 12px; box-shadow: 0 16px 40px rgba(0, 0, 0, .45); line-height: 1.3;
}
.float-card b { display: block; font-weight: 800; }
.float-card small { display: block; font-size: 14px; color: var(--ink-400); }
.icon-box { width: 40px; height: 40px; border-radius: 10px; background: var(--o-500); color: var(--ink-950); display: grid; place-items: center; }
.sparks { position: absolute; top: 34px; inset-inline-end: 34px; width: 0; height: 0; }
.spk { position: absolute; width: 6px; height: 6px; border-radius: 50%; background: var(--o-300); animation: spark 1.8s ease-out infinite; }

/* ---------- marquees + gallery ---------- */
.work { padding: 24px 0 88px; display: flex; flex-direction: column; gap: 22px; }
.marq { overflow: hidden; }
.track { display: flex; width: max-content; }
.marq:hover .track { animation-play-state: paused; }
.ticker { background: var(--o-500); color: var(--ink-950); transform: rotate(-1.2deg); margin-inline: -20px; }
.ticker .track {
  gap: 36px; padding-block: 14px; font-family: 'Cairo', sans-serif; font-weight: 900; font-size: 24px; white-space: nowrap;
  animation: marqRev 26s linear infinite;
}
.gallery .track { gap: 20px; padding-block: 6px; animation: marq 38s linear infinite; }
.head-row { margin-top: 40px; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px; }
.head-row > div { display: flex; flex-direction: column; gap: 8px; }
.link-arrow { display: flex; align-items: center; gap: 8px; min-height: 44px; font-weight: 700; text-decoration: none; }

.shot { margin: 0; position: relative; height: 300px; width: 260px; border-radius: 20px; overflow: hidden; flex-shrink: 0; }
.shot.lg { width: 340px; }
.shot.md { width: 300px; }
.shot img, .tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.shot:hover img, .tile:hover img { transform: scale(1.07); }
.cap {
  position: absolute; bottom: 12px; inset-inline-start: 12px;
  background: rgba(14, 15, 17, .85); color: var(--ink-50); padding: 6px 12px; border-radius: 10px; font-weight: 700; font-size: 15px;
}

/* ---------- services ---------- */
.services { background: var(--ink-900); padding-block: 96px; border-block: 1px solid var(--ink-700); }
.card { background: var(--ink-800); border: 1px solid var(--ink-700); border-radius: 20px; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.card-top { display: flex; justify-content: space-between; align-items: center; }
.card-icon { width: 52px; height: 52px; border-radius: 14px; background: var(--o-900); color: var(--o-400); display: grid; place-items: center; }
.card-icon .i { stroke-width: 1.8; }
.card-num { font-family: 'Cairo', sans-serif; font-weight: 900; font-size: 22px; color: var(--ink-700); }
.card h3, .step h3 { font-weight: 800; font-size: 22px; }
.card p, .step p { color: var(--ink-400); }
.lift { transition: translate .35s cubic-bezier(.2, .7, .2, 1), border-color .35s; }
.lift:hover { translate: 0 -8px; border-color: var(--o-500); }

/* ---------- need picker (farm / home), pure CSS via radio + :has() ---------- */
.need { padding-block: 96px 0; }
.seg { border: 0; margin: 0; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; max-width: 480px; }
.seg label {
  position: relative; min-height: 56px; border-radius: 14px; border: 1px solid var(--ink-700);
  display: grid; place-items: center; padding: 4px 8px; text-align: center; line-height: 1.3;
  font-family: 'Cairo', sans-serif; font-weight: 800; font-size: 18px; cursor: pointer;
  transition: background-color .2s, color .2s, border-color .2s;
}
.seg label:hover { border-color: var(--o-500); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label:has(:checked) { background: var(--o-500); border-color: var(--o-500); color: var(--ink-950); }
.seg label:has(:focus-visible) { outline: 3px solid var(--o-300); outline-offset: 3px; }
.panel { display: flex; flex-direction: column; gap: 16px; }
.panel.home { display: none; }
.need:has([value="home"]:checked) .panel.home { display: flex; }
.need:has([value="home"]:checked) .panel.farm { display: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 0; padding: 0; }
.chips li { background: var(--o-900); color: var(--o-300); border-radius: 999px; padding: 4px 12px; font-size: 15px; font-weight: 700; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.tile { margin: 0; position: relative; height: 240px; border-radius: 14px; overflow: hidden; }
.tile .cap { bottom: 8px; inset-inline-start: 8px; padding: 3px 10px; font-size: 14px; border-radius: 8px; }

/* ---------- steps ---------- */
.steps { padding-block: 96px; }
.step { position: relative; background: var(--ink-900); border: 1px solid var(--ink-700); border-radius: 20px; padding: 32px; display: flex; flex-direction: column; gap: 12px; overflow: hidden; }
.step > * { position: relative; }
.step .step-bg { position: absolute; top: -18px; inset-inline-end: 12px; font-family: 'Cairo', sans-serif; font-weight: 900; font-size: 120px; line-height: 1; color: var(--o-900); }
.pill { align-self: flex-start; background: var(--o-500); color: var(--ink-950); font-weight: 800; font-size: 14px; padding: 4px 12px; border-radius: 999px; }

/* ---------- location ---------- */
.location { padding-bottom: 96px; }
.loc-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(330px, 100%), 1fr)); gap: 24px; }
.loc-info { background: var(--ink-900); border: 1px solid var(--ink-700); border-radius: 24px; padding: 36px; display: flex; flex-direction: column; gap: 20px; justify-content: center; }
.loc-info h2 { font-size: clamp(28px, 4vw, 36px); }
.info-row { display: flex; gap: 14px; align-items: center; }
.info-icon { width: 44px; height: 44px; flex-shrink: 0; border-radius: 12px; background: var(--o-900); color: var(--o-400); display: grid; place-items: center; }
.map { min-height: 400px; border-radius: 24px; border: 1px solid var(--ink-700); overflow: hidden; background: var(--ink-900); }
.map iframe { display: block; width: 100%; height: 100%; min-height: 400px; border: 0; }

/* ---------- CTA band ---------- */
.cta { padding-bottom: 96px; }
.cta-band {
  position: relative; background: var(--o-500); color: var(--ink-950); border-radius: 28px; padding: 60px 44px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; overflow: hidden;
}
.cta-band .ring { position: absolute; inset-inline-end: -80px; top: -80px; width: 260px; height: 260px; border: 2px dashed rgba(14, 15, 17, .25); border-radius: 50%; }
.cta-text { position: relative; display: flex; flex-direction: column; gap: 8px; max-width: 640px; }
.cta-text h2 { line-height: 1.25; }
.cta-text p { font-size: 19px; font-weight: 500; }

/* ---------- footer, floating button, phone bar ---------- */
.site-footer { border-top: 1px solid var(--ink-700); padding-block: 28px 96px; }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-size: 15px; color: var(--ink-400); }
.site-footer a { font-weight: 700; }
.fab { position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 30; width: 60px; height: 60px; border-radius: 50%; background: var(--o-500); color: var(--ink-950); display: grid; place-items: center; }
.bottom-bar { display: none; }

@media (max-width: 720px) {
  .nav, .header-wa, .fab { display: none; }
  .bottom-bar {
    display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 8px;
    position: fixed; inset-inline: 0; bottom: 0; z-index: 30;
    background: rgba(14, 15, 17, .94); border-top: 1px solid var(--ink-700);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
  }
  .bottom-bar .btn { min-height: 50px; padding: 0 8px; }
  .wrap { padding-inline: 18px; }
  .hero { padding-block: 32px 40px; gap: 36px; }
  .services, .steps { padding-block: 56px; }
  .need { padding-top: 56px; }
  .tile { height: 190px; }
  .btn-line { align-self: stretch; }
  .loc-info { padding: 24px; }
  .cta-band { padding: 40px 24px; }
}

/* ---------- motion ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(28px); } to { opacity: 1; transform: none; } }
@keyframes marq { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@keyframes marqRev { from { transform: translateX(-50%); } to { transform: translateX(0); } }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(255, 107, 26, .55); } 70% { box-shadow: 0 0 0 18px rgba(255, 107, 26, 0); } 100% { box-shadow: 0 0 0 0 rgba(255, 107, 26, 0); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes spark { 0% { opacity: 0; transform: translate(0, 0) scale(1); } 20% { opacity: 1; } 100% { opacity: 0; transform: translate(var(--sx), var(--sy)) scale(.3); } }
@keyframes spin { to { transform: rotate(360deg); } }

.fu { opacity: 0; animation: fadeUp .8s cubic-bezier(.2, .7, .2, 1) forwards; }
.d1 { animation-delay: .1s; } .d2 { animation-delay: .25s; } .d3 { animation-delay: .4s; } .d4 { animation-delay: .55s; } .d5 { animation-delay: .7s; }
/* Reveal on scroll where supported; elsewhere content simply shows. */
@supports (animation-timeline: view()) {
  .rv { animation: fadeUp linear both; animation-timeline: view(); animation-range: entry 0% entry 45%; }
}
.pulse { animation: pulse 2.2s infinite; }
.floaty { animation: floaty 4s ease-in-out infinite; }
.spin { animation: spin 18s linear infinite; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .fu, .rv, .track, .pulse, .floaty, .spk, .spin { animation: none !important; opacity: 1 !important; }
  .spk { display: none; }
}
