/* Watan — joinwatan.com
   Clean platform, Gul colours: lapis (learn), turquoise (work), pomegranate (build), saffron (explore). */

:root {
  --ink: #11142A;
  --ink-2: #474C63;
  --ink-3: #5F6479;
  --ground: #FFFFFF;
  --tone: #F4F5F8;
  --tone-2: #E9EBF1;
  --night: #0E1330;

  --learn: #1D3FA8;
  --learn-soft: #E7ECFA;
  --work: #0A7C76;
  --work-soft: #E1F2F0;
  --build: #C22A43;
  --build-soft: #FBE6E9;
  --explore: #F2B321;
  --explore-ink: #7A5300;
  --explore-soft: #FDF2D3;

  --primary: #1D3FA8;
  --primary-hover: #15307F;

  --font: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-fa: "Vazirmatn", "Schibsted Grotesk", system-ui, sans-serif;

  --wrap: 1200px;
  --gutter: clamp(20px, 4vw, 40px);
  --r-sm: 12px;
  --r-md: 20px;
  --r-lg: 28px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 18px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--ground);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
html[dir="rtl"] body { font-family: var(--font-fa); line-height: 1.8; }
[lang="prs"], [lang="ps"] { font-family: var(--font-fa); }

img { display: block; max-width: 100%; height: auto; }
a { color: var(--primary); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
::selection { background: var(--explore); color: var(--ink); }
:focus-visible { outline: 3px solid var(--primary); outline-offset: 3px; border-radius: 6px; }
html { scrollbar-color: #C9CCD8 transparent; }

.sr-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.skip { position: absolute; inset-inline-start: 16px; top: -80px; z-index: 100; background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-sm); text-decoration: none; }
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

.h2 { font-size: clamp(34px, 4.2vw, 56px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 700; margin: 0; text-wrap: balance; }
.h3 { font-size: 24px; line-height: 1.2; letter-spacing: -0.02em; font-weight: 700; margin: 0 0 8px; }
html[dir="rtl"] .h2, html[dir="rtl"] .h3, html[dir="rtl"] .hero__title { letter-spacing: 0; line-height: 1.35; }

/* Icons */
.ico { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
html[dir="rtl"] .ico--arrow { transform: scaleX(-1); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 20px; border-radius: 999px;
  font-weight: 600; font-size: 16px; text-decoration: none; white-space: nowrap;
  border: 0; cursor: pointer;
  transition: background-color .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
}
.btn:active { transform: scale(0.97); }
.btn--lg { min-height: 54px; padding: 0 28px; font-size: 17px; }
.btn--primary { background: var(--primary); color: #fff; }
.btn--primary:hover { background: var(--primary-hover); }
.btn--ghost { background: var(--tone); color: var(--ink); }
.btn--ghost:hover { background: var(--tone-2); }
.btn--text { background: transparent; color: var(--primary); padding: 0 12px; }
.btn--text:hover { background: var(--learn-soft); }
.btn--text:hover .ico--arrow { transform: translateX(3px); }
html[dir="rtl"] .btn--text:hover .ico--arrow { transform: scaleX(-1) translateX(3px); }
.ico--arrow { transition: transform .25s var(--ease); }
.btn--light { background: #fff; color: var(--night); }
.btn--light:hover { background: var(--explore); }

/* Nav */
.nav { position: sticky; top: 0; z-index: 50; background: rgba(255,255,255,0.94); transition: box-shadow .3s var(--ease); }
.nav.is-scrolled { box-shadow: 0 1px 0 var(--tone-2), 0 8px 24px -16px rgba(17,20,42,0.18); }
.nav__in { display: flex; align-items: center; gap: 32px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand__mark { width: 34px; height: 34px; }
.brand__name { font-family: var(--font); font-size: 22px; font-weight: 700; letter-spacing: -0.03em; }
.nav__links { display: flex; gap: 4px; flex: 1; }
.nav__links a { color: var(--ink-2); text-decoration: none; font-size: 16px; font-weight: 500; padding: 10px 14px; border-radius: 999px; transition: background-color .2s var(--ease), color .2s var(--ease); }
.nav__links a:hover { background: var(--tone); color: var(--ink); }
.nav__end { display: flex; align-items: center; gap: 12px; }
.lang { display: flex; background: var(--tone); border-radius: 999px; padding: 4px; }
.lang__b { border: 0; background: transparent; border-radius: 999px; padding: 0 12px; min-height: 36px; min-width: 44px; font-size: 14px; font-weight: 600; color: var(--ink-2); cursor: pointer; transition: background-color .2s var(--ease), color .2s var(--ease); }
.lang__b[lang] { font-family: var(--font-fa); font-size: 15px; }
.lang__b:hover { color: var(--ink); }
.lang__b[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(17,20,42,.08), 0 2px 8px -2px rgba(17,20,42,.12); }

/* Hero */
.hero { padding: clamp(56px, 8vw, 104px) 0 0; text-align: center; }
.hero__in { display: flex; flex-direction: column; align-items: center; }
.hero__gul { width: clamp(88px, 10vw, 120px); height: auto; margin-bottom: 32px; overflow: visible; }
.hero__title { font-size: clamp(44px, 6.6vw, 92px); line-height: 0.98; letter-spacing: -0.04em; font-weight: 700; margin: 0; max-width: 15ch; text-wrap: balance; }
html[dir="rtl"] .hero__title { max-width: 14ch; font-weight: 800; }
.hero__lead { font-size: clamp(18px, 1.6vw, 22px); color: var(--ink-2); max-width: 46ch; margin: 24px 0 0; text-wrap: pretty; }
.hero__actions { display: flex; gap: 12px; flex-wrap: wrap; justify-content: center; margin-top: 36px; }
.hero__photo { margin-top: clamp(56px, 7vw, 88px); }
.hero__photo img { width: 100%; aspect-ratio: 21 / 9; object-fit: cover; object-position: center 40%; border-radius: var(--r-lg); }

/* Gul assembly: four quarters meet, the core lands. Visible by default. */
.js .hero__gul .q { transform-box: fill-box; transform-origin: center; animation: q-in 1.1s var(--ease) both; }
.js .hero__gul .q--1 { --dx: -14px; --dy: -14px; animation-delay: .05s; }
.js .hero__gul .q--2 { --dx: 14px; --dy: -14px; animation-delay: .12s; }
.js .hero__gul .q--3 { --dx: -14px; --dy: 14px; animation-delay: .19s; }
.js .hero__gul .q--4 { --dx: 14px; --dy: 14px; animation-delay: .26s; }
.js .hero__gul .core { transform-box: fill-box; transform-origin: center; animation: core-in .9s var(--ease) .45s both; }
@keyframes q-in { from { transform: translate(var(--dx), var(--dy)); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes core-in { from { transform: scale(.4) rotate(-45deg); opacity: 0; } to { transform: none; opacity: 1; } }

/* Apps */
.apps { padding: clamp(96px, 11vw, 144px) 0 clamp(80px, 9vw, 120px); }
.apps__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.apps__sub { margin: 0; color: var(--ink-2); max-width: 34ch; }
.seg { display: inline-flex; gap: 4px; flex-wrap: wrap; background: var(--tone); padding: 6px; border-radius: 999px; margin-top: 36px; }
.seg__b { display: inline-flex; align-items: center; gap: 8px; border: 0; background: transparent; border-radius: 999px; min-height: 44px; padding: 0 18px; font-weight: 600; font-size: 16px; color: var(--ink-2); cursor: pointer; transition: background-color .2s var(--ease), color .2s var(--ease); }
.seg__b:hover { color: var(--ink); }
.seg__b[aria-checked="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(17,20,42,.08), 0 2px 8px -2px rgba(17,20,42,.12); }
.dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; transform: rotate(45deg); }
.dot--learn { background: var(--learn); } .dot--work { background: var(--work); } .dot--build { background: var(--build); } .dot--explore { background: var(--explore); }

.grid { list-style: none; margin: 40px 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.app { transition: opacity .35s var(--ease), transform .35s var(--ease); }
.app[hidden] { display: none; }
.app.is-in { animation: app-in .45s var(--ease) both; }
@keyframes app-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.app__a { display: flex; gap: 20px; align-items: flex-start; padding: 24px; border-radius: var(--r-md); color: var(--ink); text-decoration: none; height: 100%; transition: background-color .25s var(--ease); }
.app__a:hover { background: var(--tone); }
.app__a:hover .icon { transform: translateY(-2px) rotate(-3deg); }
.icon { width: 60px; height: 60px; flex: none; border-radius: 18px; display: grid; place-items: center; transition: transform .35s var(--ease); }
.icon svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.icon--learn { background: var(--learn); } .icon--work { background: var(--work); } .icon--build { background: var(--build); }
.icon--explore { background: var(--explore); } .icon--explore svg { stroke: var(--ink); }
.app__txt { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.app__name { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.app__dari { font-size: 18px; font-weight: 600; color: var(--ink-3); letter-spacing: 0; }
.app__desc { color: var(--ink-2); font-size: 16px; line-height: 1.5; }
.app__meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 14px; margin-top: 4px; }
.app__url { color: var(--ink-3); direction: ltr; unicode-bidi: isolate; }
.state { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.state--live { color: #0A6B3F; } .state--live::before { background: #12A060; box-shadow: 0 0 0 3px #D7F2E3; }
.state--soon { color: var(--ink-3); } .state--soon::before { background: #B9BDCB; }

/* Made: editorial, one photograph, four principles */
.made { background: var(--tone); padding: clamp(104px, 12vw, 160px) 0; }
.made__in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(40px, 7vw, 104px); align-items: center; }
.made__photo { margin: 0; }
.made__photo img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; filter: grayscale(1) contrast(1.05); border-radius: var(--r-md); }
.made__photo figcaption { margin-top: 12px; font-size: 14px; color: var(--ink-3); }
.made__lead { margin: 24px 0 0; font-size: 20px; color: var(--ink-2); max-width: 44ch; }
.pr { margin: 48px 0 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 40px 48px; }
.pr__i dt { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; margin: 0 0 8px; }
.pr__i dd { margin: 0; color: var(--ink-2); font-size: 17px; }
html[dir="rtl"] .pr__i dt { letter-spacing: 0; }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.notify { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; width: 100%; max-width: 560px; }
.notify input { flex: 1 1 260px; min-height: 54px; border: 0; border-radius: 999px; padding: 0 24px; font: inherit; font-size: 17px; color: var(--ink); background: var(--tone); box-shadow: inset 0 0 0 1px var(--tone-2); transition: box-shadow .2s var(--ease); }
.notify input::placeholder { color: #7A7F93; }
.notify input:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--primary); }
.notify input[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--build); }
.notify__msg { flex-basis: 100%; margin: 6px 0 0; min-height: 1.5em; font-size: 15px; font-weight: 600; color: var(--ink-2); }

/* Elan */
.elan { background: var(--night); color: #fff; padding: clamp(96px, 11vw, 144px) 0; }
.elan__head { display: flex; justify-content: space-between; align-items: flex-end; gap: 32px; flex-wrap: wrap; }
.elan__head p { margin: 0; color: #C3C8DD; max-width: 46ch; }
.elan__dari { color: var(--explore); font-family: var(--font-fa); font-weight: 800; letter-spacing: 0; }
.elan__grid { margin-top: 48px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.door { background: #171D45; border-radius: var(--r-lg); padding: 36px; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.door p { color: #C3C8DD; margin: 0 0 24px; max-width: 46ch; }
.door__ui { width: 100%; background: #222A5C; border-radius: var(--r-md); padding: 20px; margin-bottom: 28px; display: flex; flex-direction: column; gap: 12px; min-height: 150px; justify-content: center; }
.ad { display: flex; gap: 14px; align-items: center; background: #fff; color: var(--ink); border-radius: var(--r-sm); padding: 14px; }
.ad__logo { width: 52px; height: 52px; flex: none; border-radius: 12px; background: var(--build-soft); color: var(--build); display: grid; place-items: center; font-size: 12px; font-weight: 700; }
.ad__txt b { display: block; font-size: 16px; }
.ad__txt small { display: block; font-size: 13px; color: var(--ink-3); }
.ad__bar { font-size: 14px; color: #C3C8DD; }
.snip { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 15px; color: #fff; background: #0E1330; border-radius: var(--r-sm); padding: 16px; overflow-x: auto; white-space: nowrap; }

/* Every */
.every { padding: clamp(104px, 12vw, 160px) 0 0; text-align: center; }
.every .wrap { display: flex; flex-direction: column; align-items: center; }
.every__title { max-width: 20ch; }
.every__p { color: var(--ink-2); margin: 20px 0 32px; max-width: 40ch; }
.every__photo { margin: clamp(56px, 7vw, 88px) 0 0; }
.every__photo img { width: 100%; aspect-ratio: 21 / 8; object-fit: cover; object-position: center 55%; }

/* Footer */
.foot { background: var(--tone); padding: 72px 0 40px; font-size: 15px; }
.foot__top { display: flex; gap: 48px; justify-content: space-between; flex-wrap: wrap; }
.foot__cols { display: grid; grid-template-columns: repeat(5, minmax(110px, auto)); gap: 32px 48px; }
.foot__cols h3 { font-size: 15px; font-weight: 700; margin: 0 0 12px; }
.foot__cols a { display: block; color: var(--ink-2); text-decoration: none; padding: 4px 0; }
.foot__cols a:hover { color: var(--primary); text-decoration: underline; }
.foot__base { margin-top: 56px; padding-top: 24px; display: flex; justify-content: space-between; gap: 16px 32px; flex-wrap: wrap; color: var(--ink-3); font-size: 13px; box-shadow: inset 0 1px 0 var(--tone-2); }
.foot__credits { max-width: 72ch; }

/* Responsive */
@media (max-width: 1020px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .made__in { grid-template-columns: minmax(0, 1fr); }
  .made__photo img { aspect-ratio: 16 / 10; }
  .foot__cols { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  body { font-size: 17px; }
  .nav__links { display: none; }
  .nav__in { gap: 12px; min-height: 64px; justify-content: space-between; }
  .nav__end { gap: 8px; }
  .nav__end .btn--ghost { display: none; }
  .lang__b { padding: 0 8px; min-width: 40px; }
  .hero { text-align: start; }
  .hero__in { align-items: flex-start; }
  .hero__actions { justify-content: flex-start; }
  .hero__photo img { aspect-ratio: 4 / 3; border-radius: var(--r-md); }
  .seg { display: flex; overflow-x: auto; flex-wrap: nowrap; border-radius: var(--r-md); scrollbar-width: none; }
  .seg__b { flex: none; padding: 0 14px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 24px; }
  .app__a { padding: 20px 4px; border-radius: 0; box-shadow: inset 0 -1px 0 var(--tone-2); }
  .app__a:hover { background: transparent; }
  .pr { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .notify { justify-content: flex-start; }
  .notify .btn { flex: 1 1 100%; }
  .elan__grid { grid-template-columns: minmax(0, 1fr); }
  .door { padding: 28px; }
  .every { text-align: start; }
  .every .wrap { align-items: flex-start; }
  .every__photo img { aspect-ratio: 4 / 3; }
  .foot__cols { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; }
}

/* RTL: Dari names lead */
html[dir="rtl"] .elan__dari { display: none; }
html[dir="rtl"] .app__dari { order: -1; font-size: 22px; font-weight: 700; color: var(--ink); }
html[dir="rtl"] .app__latin { font-family: var(--font); font-size: 16px; font-weight: 600; color: var(--ink-3); }
html[dir="rtl"] .brand__name { font-family: var(--font-fa); font-weight: 800; letter-spacing: 0; }
