:root{
  --bg:#0b0e14;
  --surface:#101726;
  --surface-2:#0f1624;
  --text:#e8ecf5;
  --muted:#a6b0c3;
  --border:rgba(255,255,255,.08);
  --shadow:0 18px 60px rgba(0,0,0,.35);
  --accent:#60a5fa;
  --accent-2:#22c55e;
  --danger:#ef4444;
  --radius:18px;
  --radius-sm:14px;
  --container:1120px;
}

html[data-theme="light"]{
  --bg:#f6f7fb;
  --surface:#ffffff;
  --surface-2:#f3f4f8;
  --text:#0d1322;
  --muted:#4b5568;
  --border:rgba(10,20,40,.10);
  --shadow:0 18px 60px rgba(14,19,33,.12);
  --accent:#2563eb;
  --accent-2:#16a34a;
  --danger:#dc2626;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:Inter,system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background:radial-gradient(1000px 480px at 20% 0%, rgba(96,165,250,.22), transparent 70%),
             radial-gradient(900px 520px at 90% 10%, rgba(34,197,94,.18), transparent 70%),
             var(--bg);
  color:var(--text);
  min-height:100vh;
}

html[dir="rtl"] body{direction:rtl}
html[dir="rtl"] .header-inner{flex-direction:row-reverse}
html[dir="rtl"] .top-nav{flex-direction:row-reverse}
html[dir="rtl"] .section-head{flex-direction:row-reverse}
html[dir="rtl"] .back-link{justify-content:flex-end}

a{color:inherit;text-decoration:none}
img{max-width:100%;display:block}

.container{
  width:min(100%, calc(var(--container) + 40px));
  padding:0 20px;
  margin:0 auto;
}

.site-header{
  position:sticky;
  top:0;
  z-index:20;
  backdrop-filter:blur(12px);
  background:color-mix(in srgb, var(--bg) 65%, transparent);
  border-bottom:1px solid var(--border);
}
.header-inner{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 0;
}

.brand{
  display:flex;
  align-items:center;
  gap:12px;
}
.brand-mark{
  width:44px;
  height:44px;
  border-radius:14px;
  overflow:hidden;
  box-shadow:var(--shadow);
  flex:0 0 auto;
}
.brand-logo{
  width:100%;
  height:100%;
  object-fit:contain;
  background:color-mix(in srgb, var(--surface) 70%, transparent);
}
.brand-text{
  display:flex;
  flex-direction:column;
  line-height:1.1;
}
.brand-title{
  font-weight:700;
  letter-spacing:-.02em;
}
.brand-sub{
  font-size:12px;
  color:var(--muted);
  margin-top:3px;
}

.top-nav{
  display:flex;
  align-items:center;
  gap:10px;
}
.lang-switch{display:flex;align-items:center}
.lang-select{
  appearance:none;
  border-radius:999px;
  border:1px solid var(--border);
  background:color-mix(in srgb, var(--surface) 70%, transparent);
  color:var(--text);
  padding:10px 34px 10px 12px;
  font-weight:700;
  font-size:13px;
  cursor:pointer;
  background-image:linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:calc(100% - 16px) 55%, calc(100% - 11px) 55%;
  background-size:5px 5px, 5px 5px;
  background-repeat:no-repeat;
}
.lang-select:focus{outline:none;border-color:color-mix(in srgb, var(--accent) 45%, var(--border))}
.nav-link{
  font-weight:600;
  font-size:14px;
  padding:10px 12px;
  border-radius:999px;
  background:transparent;
  border:1px solid transparent;
  transition:transform .15s ease, background .15s ease, border-color .15s ease;
}
.nav-link:hover{
  background:color-mix(in srgb, var(--surface) 65%, transparent);
  border-color:var(--border);
  transform:translateY(-1px);
}

.theme-toggle{
  display:flex;
  align-items:center;
  gap:8px;
  padding:10px 12px;
  border-radius:999px;
  border:1px solid var(--border);
  background:color-mix(in srgb, var(--surface) 70%, transparent);
  color:var(--text);
  cursor:pointer;
  transition:transform .15s ease, background .15s ease;
}
.theme-toggle:hover{transform:translateY(-1px)}
.theme-toggle__icon{
  width:16px;height:16px;border-radius:6px;
  background:linear-gradient(135deg, var(--accent), var(--accent-2));
  box-shadow:0 8px 22px rgba(0,0,0,.22);
}
.theme-toggle__label{font-weight:600;font-size:13px;color:var(--muted)}

.site-main{padding:18px 0 40px}

.flash-stack{display:grid;gap:10px;margin:18px 0}
.flash{
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background:color-mix(in srgb, var(--surface) 85%, transparent);
}
.flash--success{border-color:color-mix(in srgb, var(--accent-2) 45%, var(--border))}
.flash--error{border-color:color-mix(in srgb, var(--danger) 45%, var(--border))}

.hero{padding:16px 0 26px}
.hero-card{
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:18px;
  align-items:stretch;
  border-radius:var(--radius);
  overflow:hidden;
  border:1px solid var(--border);
  background:linear-gradient(180deg, color-mix(in srgb, var(--surface) 82%, transparent), color-mix(in srgb, var(--surface) 92%, transparent));
  box-shadow:var(--shadow);
}
.hero-media{min-height:320px;background:var(--surface-2)}
.hero-media img{width:100%;height:100%;object-fit:cover}
.media-placeholder{
  width:100%;height:100%;
  background:radial-gradient(600px 260px at 35% 30%, rgba(96,165,250,.26), transparent 70%),
             radial-gradient(500px 240px at 70% 70%, rgba(34,197,94,.18), transparent 70%),
             var(--surface-2);
}
.hero-content{
  padding:22px 22px 24px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:8px 12px;
  width:max-content;
  border-radius:999px;
  border:1px solid color-mix(in srgb, var(--accent) 45%, var(--border));
  background:color-mix(in srgb, var(--surface) 70%, transparent);
  font-weight:700;
  font-size:12px;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.hero-title{
  margin:14px 0 0;
  font-size:38px;
  letter-spacing:-.03em;
  line-height:1.08;
}
.hero-summary{
  margin:12px 0 0;
  color:var(--muted);
  font-size:15px;
  line-height:1.55;
}
.hero-cta{
  margin-top:16px;
  font-weight:700;
  color:color-mix(in srgb, var(--accent) 85%, var(--text));
}
.hero-empty{
  border-radius:var(--radius);
  border:1px solid var(--border);
  background:color-mix(in srgb, var(--surface) 86%, transparent);
  padding:28px;
  box-shadow:var(--shadow);
}

.button{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid color-mix(in srgb, var(--accent) 55%, var(--border));
  background:linear-gradient(135deg, var(--accent), color-mix(in srgb, var(--accent) 35%, var(--accent-2)));
  color:#fff;
  font-weight:800;
  letter-spacing:-.01em;
  cursor:pointer;
}
.button--ghost{
  background:transparent;
  color:var(--text);
  border-color:var(--border);
}

.feed{padding:10px 0}
.section-head{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:20px;
  margin:8px 0 16px;
}
.section-title{margin:0;font-size:22px;letter-spacing:-.02em}
.section-sub{color:var(--muted);font-size:13px}

.grid{
  display:grid;
  grid-template-columns:repeat(3, minmax(0, 1fr));
  gap:16px;
}

.card{
  border-radius:var(--radius);
  overflow:hidden;
  border:1px solid var(--border);
  background:color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow:0 18px 48px rgba(0,0,0,.20);
  transform:translateY(0);
  transition:transform .15s ease, border-color .15s ease;
}
.card:hover{
  transform:translateY(-3px);
  border-color:color-mix(in srgb, var(--accent) 35%, var(--border));
}
.card-media{height:190px;background:var(--surface-2)}
.card-media img{width:100%;height:100%;object-fit:cover}
.card-body{padding:14px 14px 16px}
.card-meta{
  color:var(--muted);
  font-size:12px;
  font-weight:700;
  letter-spacing:.01em;
  margin-bottom:8px;
}
.card-title{
  font-weight:800;
  letter-spacing:-.02em;
  margin:0 0 8px;
  line-height:1.2;
}
.card-summary{
  color:var(--muted);
  font-size:13px;
  line-height:1.55;
}

.article{padding:8px 0 16px}
.article-grid{
  display:grid;
  grid-template-columns:1fr 320px;
  gap:20px;
  align-items:start;
}
.article-main{
  border-radius:var(--radius);
  border:1px solid var(--border);
  background:color-mix(in srgb, var(--surface) 90%, transparent);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.article-head{padding:22px 22px 0}
.back-link{display:inline-flex;color:var(--muted);font-weight:600;font-size:13px}
.article-title{
  margin:12px 0 0;
  font-size:34px;
  letter-spacing:-.03em;
  line-height:1.08;
}
.article-summary{margin:12px 0 0;color:var(--muted);line-height:1.55}
.article-body{padding:18px 22px 22px;font-size:15px;line-height:1.78}
.article-body p{margin:0 0 16px}

.gallery{padding:18px 22px 0}
.gallery-main{
  border-radius:var(--radius-sm);
  overflow:hidden;
  border:1px solid var(--border);
  background:var(--surface-2);
}
.gallery-main img{width:100%;height:420px;object-fit:cover}
.gallery-strip{
  display:flex;
  gap:10px;
  padding:12px 2px 2px;
  overflow:auto;
  scrollbar-width:thin;
}
.thumb{
  border:1px solid var(--border);
  background:transparent;
  border-radius:14px;
  overflow:hidden;
  padding:0;
  cursor:pointer;
  flex:0 0 auto;
  width:92px;
  height:72px;
  opacity:.92;
  transition:transform .15s ease, border-color .15s ease, opacity .15s ease;
}
.thumb:hover{transform:translateY(-2px);opacity:1}
.thumb.is-active{border-color:color-mix(in srgb, var(--accent) 55%, var(--border));opacity:1}
.thumb img{width:100%;height:100%;object-fit:cover}

.article-aside{position:sticky;top:92px}
.aside-card{
  border-radius:var(--radius);
  border:1px solid var(--border);
  background:color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow:0 18px 48px rgba(0,0,0,.18);
  padding:18px;
}
.aside-title{font-weight:900;letter-spacing:-.02em}
.aside-text{margin-top:8px;color:var(--muted);line-height:1.55;font-size:13px}
.button--ghost.button--wide{width:100%}

.site-footer{
  border-top:1px solid var(--border);
  background:color-mix(in srgb, var(--bg) 75%, transparent);
}
.footer-inner{
  padding:18px 0;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}
.footer-brand{font-weight:900;letter-spacing:-.02em}
.footer-meta{color:var(--muted);font-size:12px;margin-top:4px}
.footer-link{color:var(--muted);font-weight:700;font-size:13px}

@media (max-width: 980px){
  .hero-card{grid-template-columns:1fr}
  .hero-media{min-height:260px}
  .hero-title{font-size:32px}
  .grid{grid-template-columns:repeat(2, minmax(0, 1fr))}
  .article-grid{grid-template-columns:1fr}
  .article-aside{position:static}
}

@media (max-width: 620px){
  .header-inner{gap:10px}
  .brand-title{font-size:14px}
  .brand-sub{display:none}
  .nav-link{display:none}
  .hero-content{padding:18px}
  .hero-title{font-size:28px}
  .grid{grid-template-columns:1fr}
  .card-media{height:210px}
  .gallery-main img{height:320px}
}
