/*
Theme Name: آفرنگ
Theme URI: https://example.com
Author: آفرنگ
Author URI: https://example.com
Description: قالب اختصاصی آفرنگ — کارگاه چاپ، طراحی و برش لیزر. طراحی مینیمال و گرم با جلوه‌های عمق و سه‌بعدی سبک.
Version: 1.0.0
Requires at least: 6.4
Tested up to: 6.6
Requires PHP: 7.4
Text Domain: afarang
*/

:root{
  --bg: #FBF6EC;
  --paper: #F6EDDB;
  --ink: #3A2E22;
  --ink-soft: #7C6A56;
  --ochre: #D9A34A;
  --ochre-dark: #B9852F;
  --brick: #E0805C;
  --brick-dark: #C4623F;
  --taupe: #E1D2B6;
  --walnut: #322213;
  --walnut-soft: #4A3324;
  --line: #EDE0C6;
  --radius: 16px;
  --glass-bg: rgba(251, 246, 236, .62);
}

*{margin:0; padding:0; box-sizing:border-box;}
html{scroll-behavior:smooth;}
body{
  background:var(--bg);
  color:var(--ink);
  font-family:'Vazirmatn', sans-serif;
  line-height:1.7;
  overflow-x:hidden;
}
h1, h2, h3, .display{
  font-family:'Markazi Text', serif;
  font-weight:700;
  color:var(--ink);
}
a{color:inherit; text-decoration:none;}
img{max-width:100%; display:block;}
.wrap{max-width:1160px; margin:0 auto; padding:0 28px;}

/* perforated / laser-cut divider */
.cut-divider{
  height:1px; width:100%;
  background-image: repeating-linear-gradient(90deg, var(--taupe) 0 8px, transparent 8px 16px);
  opacity:.7; position:relative;
}
.cut-divider::before, .cut-divider::after{
  content:""; position:absolute; top:-4px; width:9px; height:9px;
  border-radius:50%; background:var(--bg); border:1px solid var(--taupe);
}
.cut-divider::before{right:-4.5px;}
.cut-divider::after{left:-4.5px;}

/* header */
header.site-header{
  position:sticky; top:0; z-index:50;
  background:var(--glass-bg);
  backdrop-filter:blur(14px) saturate(140%);
  -webkit-backdrop-filter:blur(14px) saturate(140%);
  border-bottom:1px solid rgba(225,210,182,.6);
  transition:box-shadow .3s ease, background .3s ease;
}
header.site-header.is-scrolled{
  background:rgba(251,246,236,.85);
  box-shadow:0 8px 24px -12px rgba(58,46,34,.18);
}
.nav{display:flex; align-items:center; justify-content:space-between; padding:18px 0;}
.logo{font-family:'Markazi Text', serif; font-size:30px; font-weight:700; letter-spacing:.5px; color:var(--ink);}
.logo span{color:var(--brick);}
.nav-links{display:flex; gap:32px; font-size:15px; color:var(--ink-soft); list-style:none;}
.nav-links a{position:relative; padding:4px 0; transition:color .2s;}
.nav-links a:hover{color:var(--ink);}
.nav-links a::after{
  content:""; position:absolute; bottom:0; right:0; left:0; height:2px;
  background:var(--ochre); transform:scaleX(0); transform-origin:right; transition:transform .25s ease;
}
.nav-links a:hover::after{transform:scaleX(1);}

.btn{
  display:inline-flex; align-items:center; gap:8px; padding:12px 24px; border-radius:999px;
  font-size:15px; font-weight:600; cursor:pointer;
  transition:transform .18s ease, box-shadow .18s ease, background .18s ease;
  white-space:nowrap; border:none;
}
.btn-primary{background:var(--brick); color:#FFFBF3; box-shadow:0 8px 20px -4px rgba(224,128,92,.45);}
.btn-primary:hover{background:var(--brick-dark); transform:translateY(-2px); box-shadow:0 12px 26px -4px rgba(224,128,92,.55);}
.btn-ghost{border:1.5px solid var(--taupe); color:var(--ink); background:rgba(255,255,255,.35); backdrop-filter:blur(4px);}
.btn-ghost:hover{border-color:var(--ochre-dark); background:rgba(255,255,255,.6); transform:translateY(-2px);}
.menu-toggle{display:none; font-size:26px; background:none; border:none; cursor:pointer; color:var(--ink);}

/* hero */
.hero{padding:96px 0 70px; position:relative;}
.hero-grid{display:grid; grid-template-columns:1.1fr .9fr; gap:60px; align-items:center;}
.eyebrow{display:inline-flex; align-items:center; gap:10px; font-size:13.5px; letter-spacing:1px; color:var(--ochre-dark); font-weight:700; margin-bottom:22px;}
.eyebrow::before{content:""; width:26px; height:1px; background:var(--ochre-dark);}
.hero h1{font-size:56px; line-height:1.28; margin-bottom:24px;}
.hero h1 em{font-style:normal; color:var(--brick); position:relative; display:inline-block;}
.hero-underline{position:absolute; bottom:2px; right:0; width:100%; height:10px;}
.hero-underline path{stroke:var(--ochre); stroke-width:4; fill:none; stroke-linecap:round; stroke-dasharray:340; stroke-dashoffset:340; animation:draw 1.4s .5s ease forwards;}
@media (prefers-reduced-motion: reduce){ .hero-underline path{animation:none; stroke-dashoffset:0;} }
@keyframes draw{to{stroke-dashoffset:0;}}
.hero p.lead{font-size:18px; color:var(--ink-soft); max-width:480px; margin-bottom:36px;}
.hero-ctas{display:flex; gap:16px; flex-wrap:wrap; margin-bottom:40px;}
.hero-meta{display:flex; gap:28px; font-size:14px; color:var(--ink-soft); flex-wrap:wrap;}
.hero-meta div{display:flex; align-items:center; gap:8px;}
.dot{width:6px; height:6px; border-radius:50%; background:var(--ochre); flex-shrink:0;}

/* 3D/animated hero stage — pure CSS+SVG, no external library required */
.hero-visual{
  position:relative; aspect-ratio:1/1; max-width:420px; justify-self:end;
  border-radius:24px; overflow:visible;
  background:linear-gradient(155deg, var(--walnut-soft) 0%, var(--walnut) 65%);
  box-shadow:0 30px 60px -20px rgba(50,34,19,.35);
}
.cube-stage{
  position:absolute; inset:0;
  display:flex; align-items:center; justify-content:center;
  perspective:1000px;
  padding:26px;
}
.cube-gimbal{
  transform-style:preserve-3d;
  transition:transform .18s ease-out;
  will-change:transform;
  width:100%; height:100%;
}
.machine-scene{ width:100%; height:100%; }
.machine-svg{ width:100%; height:100%; overflow:visible; }

.plate-base{ fill:#3A2818; stroke:rgba(217,163,74,.25); stroke-width:1.5; }

.cut-outline{
  fill:none; stroke:var(--ochre); stroke-width:2;
  filter:drop-shadow(0 0 5px rgba(217,163,74,.65));
  stroke-dasharray:520; stroke-dashoffset:520;
  animation:cut-draw 4s ease-in-out infinite;
}
.cut-outline-2{ animation-delay:.35s; stroke-dasharray:180; stroke-dashoffset:180; }
.cut-outline-3{ animation-delay:.6s; stroke-dasharray:130; stroke-dashoffset:130; }
@keyframes cut-draw{
  0%{ stroke-dashoffset:520; opacity:.35; }
  45%{ stroke-dashoffset:0; opacity:1; }
  80%{ stroke-dashoffset:0; opacity:1; }
  100%{ stroke-dashoffset:-520; opacity:.35; }
}

.rail{ stroke:rgba(217,163,74,.35); stroke-width:2; stroke-dasharray:2 6; }

.laser-head{ animation:head-move 4s ease-in-out infinite; transform-origin:center; }
@keyframes head-move{
  0%,100%{ transform:translateX(-72px); }
  50%{ transform:translateX(72px); }
}
.head-body{ fill:#20150C; stroke:var(--ochre); stroke-width:1.5; }
.laser-beam{
  stroke:var(--ochre); stroke-width:1.6; opacity:.85;
  filter:drop-shadow(0 0 6px rgba(217,163,74,.9));
}
.laser-dot{
  fill:var(--ochre);
  filter:drop-shadow(0 0 8px rgba(217,163,74,1));
  animation:dot-pulse 1.1s ease-in-out infinite;
}
@keyframes dot-pulse{
  0%,100%{ r:3.2; opacity:.8; }
  50%{ r:5; opacity:1; }
}

@media (prefers-reduced-motion: reduce){
  .cut-outline{ animation:none; stroke-dashoffset:0; opacity:1; }
  .laser-head{ animation:none; transform:translateX(0); }
  .laser-dot{ animation:none; }
}

.plate-ring{position:absolute; inset:18px; border-radius:16px; border:1px dashed rgba(217,163,74,.4); pointer-events:none;}
.chip{
  position:absolute; background:rgba(255,251,243,.9); border:1px solid var(--line); border-radius:10px; padding:10px 14px;
  font-size:13px; font-weight:600; box-shadow:0 10px 24px rgba(42,32,25,.14); display:flex; align-items:center; gap:8px;
  backdrop-filter:blur(6px);
}
.chip-1{top:-18px; right:-10px;}
.chip-2{bottom:-16px; left:-18px;}
.chip .dot{background:var(--brick);}

/* sections */
.section{padding:88px 0;}
.section-head{display:flex; align-items:flex-end; justify-content:space-between; margin-bottom:48px; gap:24px; flex-wrap:wrap;}
.section-head h2{font-size:38px;}
.section-head p{color:var(--ink-soft); max-width:420px; font-size:15px;}

/* services with tilt-on-hover depth */
.services-grid{display:grid; grid-template-columns:repeat(3, 1fr); gap:20px;}
.service-card{
  background:var(--paper); border-radius:var(--radius); padding:30px 26px; position:relative;
  border:1px solid var(--line); transform-style:preserve-3d; will-change:transform;
  transition:transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}
.service-card:hover{
  box-shadow:0 24px 44px -16px rgba(224,128,92,.28);
  border-color:rgba(217,163,74,.55);
}
.service-card .num{font-family:'Markazi Text', serif; font-size:15px; color:var(--ochre-dark); font-weight:700; margin-bottom:14px; letter-spacing:.5px;}
.service-card h3{font-size:22px; margin-bottom:10px; font-weight:600;}
.service-card p{font-size:14px; color:var(--ink-soft);}
.service-card .icon{width:44px; height:44px; margin-bottom:16px; color:var(--brick);}

/* process */
.process{background:var(--walnut); color:#F3E9D4; border-radius:24px; padding:64px 48px; position:relative; overflow:hidden;}
.process::before{content:""; position:absolute; inset:0; background-image: repeating-linear-gradient(90deg, rgba(193,133,43,.08) 0 1px, transparent 1px 46px); pointer-events:none;}
.process h2{color:#F3E9D4; font-size:34px; margin-bottom:8px;}
.process > p{color:#CBB99A; max-width:460px; margin-bottom:44px; font-size:15px;}
.steps{display:grid; grid-template-columns:repeat(4, 1fr); gap:0; position:relative;}
.step{padding:0 20px 0 0; position:relative;}
.step:not(:last-child)::after{content:""; position:absolute; top:14px; left:0; width:100%; height:1px; background-image: repeating-linear-gradient(90deg, #C1852B77 0 6px, transparent 6px 12px);}
.step .idx{font-family:'Markazi Text', serif; font-size:26px; color:var(--ochre); margin-bottom:14px; font-weight:700;}
.step h3{color:#F3E9D4; font-size:18px; margin-bottom:8px; font-weight:600;}
.step p{color:#B7A489; font-size:13.5px;}

/* gallery */
.gallery-grid{display:grid; grid-template-columns:repeat(4, 1fr); gap:16px;}
.gallery-item{
  aspect-ratio:1/1; border-radius:12px;
  background: repeating-linear-gradient(135deg, #E4D6B4 0 2px, #EFE4CC 2px 14px);
  border:1px solid var(--line); display:flex; align-items:flex-end; padding:14px;
  font-size:12.5px; color:var(--ink-soft); position:relative; overflow:hidden;
}
.gallery-item::before{content:"نمونه‌کار به‌زودی";}

/* CTA banner */
.cta-banner{background:var(--ochre); border-radius:24px; padding:56px 48px; display:flex; align-items:center; justify-content:space-between; gap:24px; flex-wrap:wrap;}
.cta-banner h2{color:var(--walnut); font-size:32px; max-width:480px;}
.cta-banner .btn-primary{background:var(--walnut); box-shadow:none;}
.cta-banner .btn-primary:hover{background:#150E08;}

/* footer */
footer.site-footer{background:var(--walnut); color:#CBB99A; padding:64px 0 32px; margin-top:40px;}
.footer-grid{display:grid; grid-template-columns:1.3fr 1fr 1fr; gap:40px; padding-bottom:40px;}
.footer-logo{font-family:'Markazi Text', serif; font-size:28px; color:#F3E9D4; margin-bottom:14px;}
.footer-logo span{color:var(--ochre);}
footer p{font-size:14px; color:#B7A489; max-width:280px;}
footer h4{color:#F3E9D4; font-size:15px; margin-bottom:16px; font-weight:600;}
footer ul{list-style:none;}
footer li{margin-bottom:10px; font-size:14px;}
footer li a:hover{color:var(--ochre);}
.footer-bottom{border-top:1px solid rgba(203,185,154,.2); padding-top:24px; font-size:13px; color:#8A7A62; display:flex; justify-content:space-between; flex-wrap:wrap; gap:10px;}

/* scroll reveal */
.reveal{
  opacity:0;
  transform:translateY(26px);
  transition:opacity .7s ease, transform .7s ease;
}
.reveal.is-visible{
  opacity:1;
  transform:translateY(0);
}
@media (prefers-reduced-motion: reduce){
  .reveal{opacity:1; transform:none; transition:none;}
}

/* responsive */
@media (max-width:900px){
  .hero-grid{grid-template-columns:1fr;}
  .hero-visual{justify-self:center; margin-top:20px;}
  .hero h1{font-size:40px;}
  .services-grid{grid-template-columns:repeat(2,1fr);}
  .steps{grid-template-columns:repeat(2,1fr); row-gap:32px;}
  .step:nth-child(2)::after{display:none;}
  .gallery-grid{grid-template-columns:repeat(2,1fr);}
  .footer-grid{grid-template-columns:1fr 1fr;}
}
@media (max-width:640px){
  .nav-links{display:none;}
  .menu-toggle{display:block;}
  .hero{padding:56px 0 40px;}
  .hero h1{font-size:32px;}
  .section{padding:56px 0;}
  .services-grid{grid-template-columns:1fr;}
  .steps{grid-template-columns:1fr;}
  .cta-banner{flex-direction:column; align-items:flex-start;}
  .footer-grid{grid-template-columns:1fr;}
  .process{padding:40px 24px;}
}
